Documentation: Chrome Audio API
A promise-based wrapper for the Chrome audio API.
- getAudioDevices(filter?)
- getAudioMute(streamType)
- setAudioActiveDevices(ids?)
- setAudioMute(streamType, isMuted)
- setAudioProperties(id, properties?)
getAudioDevices(filter?: chrome.audio.DeviceFilter): Promise<chrome.audio.AudioDeviceInfo[]>
Retrieves the list of available audio devices, optionally filtered.
getAudioMute(streamType: chrome.audio.StreamType): Promise<boolean>
Retrieves the system-wide mute state of the specified audio stream type.
setAudioActiveDevices(ids?: chrome.audio.DeviceIdLists): Promise<void>
Sets the lists of active input and/or output devices.
setAudioMute(streamType: chrome.audio.StreamType, isMuted: boolean): Promise<void>
Sets the mute state for the specified audio stream type.
setAudioProperties(id: string, properties?: chrome.audio.DeviceProperties): Promise<void>
Updates properties for the specified audio device.
onAudioDeviceListChanged(
callback: (devices: chrome.audio.AudioDeviceInfo[]) => void
): () => void
Adds a listener that fires when audio devices are added or removed. Returns an unsubscribe function.
onAudioLevelChanged(
callback: (event: chrome.audio.LevelChangedEvent) => void
): () => void
Adds a listener that fires when sound level changes for an active audio device. Returns an unsubscribe function.
onAudioMuteChanged(
callback: (event: chrome.audio.MuteChangedEvent) => void
): () => void
Adds a listener that fires when the mute state of the audio input or output changes. Returns an unsubscribe function.