Skip to content

volume: Remove upper limit on volume property of volume.

David Ing requested to merge ding/gst-plugins-base:fix-843 into master

This fixes #843. It changes the upper limit of the volume property on the volume element to positive infinity instead of 10.

Testing

The following command behaves as you would expect.

gst-launch-1.0 audiotestsrc ! audio/x-raw,format=S32LE ! volume volume=0.01 ! volume volume=30 ! autoaudiosink

The gst-inspect-1.0 volume command displays what you would expect. Here is an excerpt. The upper limit is displayed as inf.

  volume              : volume factor, 1.0=100%
                        flags: readable, writable, controllable
                        Double. Range:               0 -             inf Default:               1

Use Case

We have some audio files which are capable of capturing a high dynamic range (a.k.a. "HDR audio").

Imagine a lecturer is speaking at a normal volume, then a student who is far from a microphone asks a question. The student's question is captured, but it is very quiet (by a factor of 50 or 100). We have software that boosts the gain of the student's question so it can be heard.

Justification to backport into next 1.18.x

Currently, the maximum gain factor of 10.0 is quite limiting, especially in the context of HDR audio; and it removes gstreamer from the set of tools that one might use with HDR audio content.

While this does technically change GStreamer's API, it isn't really breaking the current usage of the volume property, and so I don't see any harm in a change like this.

Merge request reports