# GstStreamVolume

This interface is implemented by elements that provide a stream volume. Examples for such elements are volume and playbin.

Applications can use this interface to get or set the current stream volume. For this the "volume" GObject property can be used or the helper functions gst_stream_volume_set_volume and gst_stream_volume_get_volume. This volume is always a linear factor, i.e. 0.0 is muted 1.0 is 100%. For showing the volume in a GUI it might make sense to convert it to a different format by using gst_stream_volume_convert_volume. Volume sliders should usually use a cubic volume.

Separate from the volume the stream can also be muted by the "mute" GObject property or gst_stream_volume_set_mute and gst_stream_volume_get_mute.

Elements that provide some kind of stream volume should implement the "volume" and "mute" GObject properties and handle setting and getting of them properly. The volume property is defined to be a linear volume factor.

## GstStreamVolume

## GstAudio.StreamVolume

### Methods

#### gst_stream_volume_get_mute

    gboolean
    gst_stream_volume_get_mute (GstStreamVolume * volume)

Parameters:

`volume` –

GstStreamVolume that should be used

Returns –

Returns TRUE if the stream is muted

#### GstAudio.StreamVolume.prototype.get_mute

    function GstAudio.StreamVolume.prototype.get_mute(): {
        // javascript wrapper for 'gst_stream_volume_get_mute'
    }

Parameters:

`volume` (GstAudio.StreamVolume) –

GstAudio.StreamVolume that should be used

Returns (Number) –

Returns true if the stream is muted

#### GstAudio.StreamVolume.get_mute

    def GstAudio.StreamVolume.get_mute (self):
        #python wrapper for 'gst_stream_volume_get_mute'

Parameters:

`volume` (GstAudio.StreamVolume) –

GstAudio.StreamVolume that should be used

Returns (bool) –

Returns True if the stream is muted

#### gst_stream_volume_get_volume

    gdouble
    gst_stream_volume_get_volume (GstStreamVolume * volume,
                                  GstStreamVolumeFormat format)

Parameters:

`volume` –

GstStreamVolume that should be used

`format` –

GstStreamVolumeFormat which should be returned

Returns –

The current stream volume as linear factor

#### GstAudio.StreamVolume.prototype.get_volume

    function GstAudio.StreamVolume.prototype.get_volume(format: GstAudio.StreamVolumeFormat): {
        // javascript wrapper for 'gst_stream_volume_get_volume'
    }

Parameters:

`volume` (GstAudio.StreamVolume) –

GstAudio.StreamVolume that should be used

`format` (GstAudio.StreamVolumeFormat) –

GstAudio.StreamVolumeFormat which should be returned

Returns (Number) –

The current stream volume as linear factor

#### GstAudio.StreamVolume.get_volume

    def GstAudio.StreamVolume.get_volume (self, format):
        #python wrapper for 'gst_stream_volume_get_volume'

Parameters:

`volume` (GstAudio.StreamVolume) –

GstAudio.StreamVolume that should be used

`format` (GstAudio.StreamVolumeFormat) –

GstAudio.StreamVolumeFormat which should be returned

Returns (float) –

The current stream volume as linear factor

#### gst_stream_volume_set_mute

    gst_stream_volume_set_mute (GstStreamVolume * volume,
                                gboolean mute)

Parameters:

`volume` –

GstStreamVolume that should be used

`mute` –

Mute state that should be set

#### GstAudio.StreamVolume.prototype.set_mute

    function GstAudio.StreamVolume.prototype.set_mute(mute: Number): {
        // javascript wrapper for 'gst_stream_volume_set_mute'
    }

Parameters:

`volume` (GstAudio.StreamVolume) –

GstAudio.StreamVolume that should be used

`mute` (Number) –

Mute state that should be set

#### GstAudio.StreamVolume.set_mute

    def GstAudio.StreamVolume.set_mute (self, mute):
        #python wrapper for 'gst_stream_volume_set_mute'

Parameters:

`volume` (GstAudio.StreamVolume) –

GstAudio.StreamVolume that should be used

`mute` (bool) –

Mute state that should be set

#### gst_stream_volume_set_volume

    gst_stream_volume_set_volume (GstStreamVolume * volume,
                                  GstStreamVolumeFormat format,
                                  gdouble val)

Parameters:

`volume` –

GstStreamVolume that should be used

`format` –

GstStreamVolumeFormat of val

`val` –

Linear volume factor that should be set

#### GstAudio.StreamVolume.prototype.set_volume

    function GstAudio.StreamVolume.prototype.set_volume(format: GstAudio.StreamVolumeFormat, val: Number): {
        // javascript wrapper for 'gst_stream_volume_set_volume'
    }

Parameters:

`volume` (GstAudio.StreamVolume) –

GstAudio.StreamVolume that should be used

`format` (GstAudio.StreamVolumeFormat) –

GstAudio.StreamVolumeFormat of val

`val` (Number) –

Linear volume factor that should be set

#### GstAudio.StreamVolume.set_volume

    def GstAudio.StreamVolume.set_volume (self, format, val):
        #python wrapper for 'gst_stream_volume_set_volume'

Parameters:

`volume` (GstAudio.StreamVolume) –

GstAudio.StreamVolume that should be used

`format` (GstAudio.StreamVolumeFormat) –

GstAudio.StreamVolumeFormat of val

`val` (float) –

Linear volume factor that should be set

### Functions

#### gst_stream_volume_convert_volume

    gdouble
    gst_stream_volume_convert_volume (GstStreamVolumeFormat from,
                                      GstStreamVolumeFormat to,
                                      gdouble val)

Parameters:

`from` –

GstStreamVolumeFormat to convert from

`to` –

GstStreamVolumeFormat to convert to

`val` –

Volume in from format that should be converted

Returns –

the converted volume

#### GstAudio.prototype.stream_volume_convert_volume

    function GstAudio.prototype.stream_volume_convert_volume(from: GstAudio.StreamVolumeFormat, to: GstAudio.StreamVolumeFormat, val: Number): {
        // javascript wrapper for 'gst_stream_volume_convert_volume'
    }

Parameters:

`from` (GstAudio.StreamVolumeFormat) –

GstAudio.StreamVolumeFormat to convert from

`to` (GstAudio.StreamVolumeFormat) –

GstAudio.StreamVolumeFormat to convert to

`val` (Number) –

Volume in from format that should be converted

Returns (Number) –

the converted volume

#### GstAudio.stream_volume_convert_volume

    def GstAudio.stream_volume_convert_volume (from, to, val):
        #python wrapper for 'gst_stream_volume_convert_volume'

Parameters:

`from` (GstAudio.StreamVolumeFormat) –

GstAudio.StreamVolumeFormat to convert from

`to` (GstAudio.StreamVolumeFormat) –

GstAudio.StreamVolumeFormat to convert to

`val` (float) –

Volume in from format that should be converted

Returns (float) –

the converted volume

### Properties

#### mute

    “mute” gboolean

Flags : Read / Write

#### mute

    “mute” Number

Flags : Read / Write

#### mute

    “self.props.mute” bool

Flags : Read / Write

#### volume

    “volume” gdouble

Flags : Read / Write

#### volume

    “volume” Number

Flags : Read / Write

#### volume

    “self.props.volume” float

Flags : Read / Write

## Function Macros

### GST_STREAM_VOLUME_GET_INTERFACE

    #define GST_STREAM_VOLUME_GET_INTERFACE(obj) GST_STREAM_VOLUME_GET_IFACE(obj)

## Enumerations

### GstStreamVolumeFormat

Different representations of a stream volume. gst_stream_volume_convert_volume allows to convert between the different representations.

Formulas to convert from a linear to a cubic or dB volume are cbrt(val) and 20 * log10 (val).

##### Members

`GST_STREAM_VOLUME_FORMAT_LINEAR` (0) –

Linear scale factor, 1.0 = 100%

`GST_STREAM_VOLUME_FORMAT_CUBIC` (1) –

Cubic volume scale

`GST_STREAM_VOLUME_FORMAT_DB` (2) –

Logarithmic volume scale (dB, amplitude not power)

### GstAudio.StreamVolumeFormat

Different representations of a stream volume. GstAudio.prototype.stream_volume_convert_volume allows to convert between the different representations.

Formulas to convert from a linear to a cubic or dB volume are cbrt(val) and 20 * log10 (val).

##### Members

`GstAudio.StreamVolumeFormat.LINEAR` (0) –

Linear scale factor, 1.0 = 100%

`GstAudio.StreamVolumeFormat.CUBIC` (1) –

Cubic volume scale

`GstAudio.StreamVolumeFormat.DB` (2) –

Logarithmic volume scale (dB, amplitude not power)

### GstAudio.StreamVolumeFormat

Different representations of a stream volume. GstAudio.stream_volume_convert_volume allows to convert between the different representations.

Formulas to convert from a linear to a cubic or dB volume are cbrt(val) and 20 * log10 (val).

##### Members

`GstAudio.StreamVolumeFormat.LINEAR` (0) –

Linear scale factor, 1.0 = 100%

`GstAudio.StreamVolumeFormat.CUBIC` (1) –

Cubic volume scale

`GstAudio.StreamVolumeFormat.DB` (2) –

Logarithmic volume scale (dB, amplitude not power)

The results of the search are