Skip to content

Audio

exception CvcImportError (*args)

Bases: ImportError

class AudioStream (stream: MixerStream, control: MixerControl, parent: Audio, **kwargs)

Bases: Service

A class representing a stream of audio (i.e. speakers, microphones, applications and recorders)

This class also enables the control of the contained stream (e.g. volume and mute state)

Default service constructor (base constructor)

  • Parameters: **kwargs

    mapped to signal connections (e.g. on_clicked=lambda *_: … connects the given function to the signal “clicked”, notify_my_property=my_func connects the given function to the signal “notify::my-property”)

signal changed (self) NoneType

signal closed (self) NoneType

property icon_name str

A suggested icon name for this stream type

  • Return type: str

property id int

The identifier of this stream

  • Return type: int

property name str

The display name associated with this stream

  • Return type: str

property description str

Text descriping this stream’s purpose

  • Return type: str

property application_id str

This stream’s application’s identifier (if any)

  • Return type: str

property state str

The state this stream is currently in

  • Return type: str

property stream MixerStream

The actual stream object this class is holding

  • Return type: Cvc.MixerStream

property volume float

The current volume value for this stream (limited to parent’s max_volume)

  • Return type: float

property muted bool

Whether this stream is in a mute state currently or not

  • Return type: bool

property type str

def notifier (name: str, *args)

def close ()

class Audio (max_volume: int = 100, controller_name: str = 'fabric audio control', **kwargs)

Bases: Service

  • Parameters:
    • max_volume (int , optional) — default maximum volume for all streams, this limit only works if volume setting is done through this service, defaults to 100
    • controller_name (str , optional) — the name of this service’s mixer controll, defaults to “fabric audio control”

signal changed (self) NoneType

signal speaker_changed (self) NoneType

signal microphone_changed (self) NoneType

signal stream_added (self) NoneType

signal stream_removed (self) NoneType

property speaker AudioStream

The default speaker stream begin currently in use (if any)

  • Return type: AudioStream

property speakers list[AudioStream]

A list of all speaker streams connected to this device

  • Return type: list[AudioStream]

property microphone AudioStream

The default microphone stream (if any)

  • Return type: AudioStream

property microphones list[AudioStream]

A list of all microphone streams connected to this device

  • Return type: list[AudioStream]

property applications list[AudioStream]

A list of all application streams outputing audio at the moment

  • Return type: list[AudioStream]

property recorders list[AudioStream]

A list of application streams recording audio at the moment

  • Return type: list[AudioStream]

property max_volume int

The maximum volume value all streams can reach by setting the volume through this service

  • Return type: int

property state str

static get_stream_type (stream: MixerStream, default=None) str | None