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.0Functions
constructor__init__() -> NoneSource Code
def __init__(self) -> None:
super().__init__()
self._control: Optional[AudioControl] = NoneReturns
Nonefuncprepare() -> boolSource 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 NoneReturns
boolfuncreader() -> 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 NoneReturns
typing.Optional[str]