GstAudio.StreamVolume

g GObject.GInterface GObject.GInterface GstAudio.StreamVolume GstAudio.StreamVolume GObject.GInterface->GstAudio.StreamVolume

Implementations:

None

Methods

class

convert_volume (from_, to, val)

get_mute ()

get_volume (format)

set_mute (mute)

set_volume (format, val)

Virtual Methods

None

Properties

Name

Type

Flags

Short Description

mute

bool

r/w

Mute the audio channel without changing the volume

volume

float

r/w

Linear volume factor, 1.0=100%

Signals

None

Fields

None

Class Details

class GstAudio.StreamVolume
Bases:

GObject.GInterface

Structure:

GstAudio.StreamVolumeInterface

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.Object property can be used or the helper functions GstAudio.StreamVolume.set_volume() and GstAudio.StreamVolume.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 GstAudio.StreamVolume.convert_volume(). Volume sliders should usually use a cubic volume.

Separate from the volume the stream can also be muted by the “mute” GObject.Object property or GstAudio.StreamVolume.set_mute() and GstAudio.StreamVolume.get_mute().

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

classmethod convert_volume(from_, to, val)[source]
Parameters:
Returns:

the converted volume

Return type:

float

get_mute()[source]
Returns:

Returns True if the stream is muted

Return type:

bool

get_volume(format)[source]
Parameters:

format (GstAudio.StreamVolumeFormat) – GstAudio.StreamVolumeFormat which should be returned

Returns:

The current stream volume as linear factor

Return type:

float

set_mute(mute)[source]
Parameters:

mute (bool) – Mute state that should be set

set_volume(format, val)[source]
Parameters:

Property Details

GstAudio.StreamVolume.props.mute
Name:

mute

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Mute the audio channel without changing the volume

GstAudio.StreamVolume.props.volume
Name:

volume

Type:

float

Default Value:

1.0

Flags:

READABLE, WRITABLE

Linear volume factor, 1.0=100%