Skip to content

Audio

import { Aside } from “@astrojs/starlight/components”; import TypeSignature from “@components/TypeSignature.astro”;

<TypeSignature typeName={ “CvcImportError” } typePrefix={ “exception” } typeArgList={ ”(*args)” }> CvcImportError

Bases: ImportError

<TypeSignature typeName={ “AudioStream” } typePrefix={ “class” } typeArgList={ “(stream: MixerStream, control: MixerControl, parent: Audio, **kwargs)” }> AudioStream

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”)

<TypeSignature typeName={ “changed” } typePrefix={ “signal” } typeArgList={ “(self)” } returnType={ “NoneType” }> changed

<TypeSignature typeName={ “closed” } typePrefix={ “signal” } typeArgList={ “(self)” } returnType={ “NoneType” }> closed

<TypeSignature typeName={ “icon_name” } typePrefix={ “property” } returnType={ “str” }> icon_name

A suggested icon name for this stream type

  • Return type: str

<TypeSignature typeName={ “id” } typePrefix={ “property” } returnType={ “int” }> id

The identifier of this stream

  • Return type: int

<TypeSignature typeName={ “name” } typePrefix={ “property” } returnType={ “str” }> name

The display name associated with this stream

  • Return type: str

<TypeSignature typeName={ “description” } typePrefix={ “property” } returnType={ “str” }> description

Text descriping this stream’s purpose

  • Return type: str

<TypeSignature typeName={ “application_id” } typePrefix={ “property” } returnType={ “str” }> application_id

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

  • Return type: str

<TypeSignature typeName={ “state” } typePrefix={ “property” } returnType={ “str” }> state

The state this stream is currently in

  • Return type: str

<TypeSignature typeName={ “stream” } typePrefix={ “property” } returnType={ “MixerStream” }> stream

The actual stream object this class is holding

  • Return type: Cvc.MixerStream

<TypeSignature typeName={ “volume” } typePrefix={ “property” } returnType={ “float” }> volume

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

  • Return type: float

<TypeSignature typeName={ “muted” } typePrefix={ “property” } returnType={ “bool” }> muted

Whether this stream is in a mute state currently or not

  • Return type: bool

<TypeSignature typeName={ “type” } typePrefix={ “property” } returnType={ “str” }> type

<TypeSignature typeName={ “notifier” } typePrefix={ “def” } typeArgList={ “(name: str, *args)” }> notifier

<TypeSignature typeName={ “close” } typePrefix={ “def” } typeArgList={ ”()” }> close

<TypeSignature typeName={ “Audio” } typePrefix={ “class” } typeArgList={ “(max_volume: int = 100, controller_name: str = ‘fabric audio control’, **kwargs)” }> Audio

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”

<TypeSignature typeName={ “changed” } typePrefix={ “signal” } typeArgList={ “(self)” } returnType={ “NoneType” }> changed

<TypeSignature typeName={ “speaker_changed” } typePrefix={ “signal” } typeArgList={ “(self)” } returnType={ “NoneType” }> speaker_changed

<TypeSignature typeName={ “microphone_changed” } typePrefix={ “signal” } typeArgList={ “(self)” } returnType={ “NoneType” }> microphone_changed

<TypeSignature typeName={ “stream_added” } typePrefix={ “signal” } typeArgList={ “(self)” } returnType={ “NoneType” }> stream_added

<TypeSignature typeName={ “stream_removed” } typePrefix={ “signal” } typeArgList={ “(self)” } returnType={ “NoneType” }> stream_removed

<TypeSignature typeName={ “speaker” } typePrefix={ “property” } returnType={ “AudioStream” }> speaker

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

  • Return type: AudioStream

<TypeSignature typeName={ “speakers” } typePrefix={ “property” } returnType={ “list[AudioStream]” }> speakers

A list of all speaker streams connected to this device

  • Return type: list[AudioStream]

<TypeSignature typeName={ “microphone” } typePrefix={ “property” } returnType={ “AudioStream” }> microphone

The default microphone stream (if any)

  • Return type: AudioStream

<TypeSignature typeName={ “microphones” } typePrefix={ “property” } returnType={ “list[AudioStream]” }> microphones

A list of all microphone streams connected to this device

  • Return type: list[AudioStream]

<TypeSignature typeName={ “applications” } typePrefix={ “property” } returnType={ “list[AudioStream]” }> applications

A list of all application streams outputing audio at the moment

  • Return type: list[AudioStream]

<TypeSignature typeName={ “recorders” } typePrefix={ “property” } returnType={ “list[AudioStream]” }> recorders

A list of application streams recording audio at the moment

  • Return type: list[AudioStream]

<TypeSignature typeName={ “max_volume” } typePrefix={ “property” } returnType={ “int” }> max_volume

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

  • Return type: int

<TypeSignature typeName={ “state” } typePrefix={ “property” } returnType={ “str” }> state

<TypeSignature typeName={ “get_stream_type” } typePrefix={ “static” } typeArgList={ “(stream: MixerStream, default=None)” } returnType={ “str | None” }> get_stream_type