Selkies
Developer Referencecapture_demand

MicrophoneDemand

The virtual microphone's recorders, as the sound server lists them.

A conferencing application holds an uncorked stream for as long as it runs and mutes in software, so this decides when the browser is asked, not whether the indicator is honest.

Attributes

attributesubject
= 'microphone'
attributerelease_seconds
= 10.0

Functions

constructor__init__() -> None
Source Code
def __init__(self) -> None:
    super().__init__()
    self._control: Optional[AudioControl] = None

Returns

None
funcprepare() -> bool
Source Code
async def prepare(self) -> bool:
    if self._control is None:
        control = AudioControl("selkies-mic-demand")
        if not await control.open():
            return False
        self._control = control
    module, _owned = await self._control.ensure_virtual_microphone(
        app_settings.audio_device_name, is_pcmflux_capturing=False)
    return module is not None

Returns

bool
funcreader() -> Optional[str]
Source Code
async def reader(self) -> Optional[str]:
    if self._control is None:
        return None
    names = await self._control.recorders(VIRTUAL_MIC_SOURCE_NAMES)
    return names[0] if names else None

Returns

typing.Optional[str]

On this page

Edit on GitHub