Skip to content

Latest commit

 

History

History
107 lines (68 loc) · 2.44 KB

File metadata and controls

107 lines (68 loc) · 2.44 KB

audio

Documentation: Chrome Audio API

A promise-based wrapper for the Chrome audio API.

Methods

Events


getAudioDevices

getAudioDevices(filter?: chrome.audio.DeviceFilter): Promise<chrome.audio.AudioDeviceInfo[]>

Retrieves the list of available audio devices, optionally filtered.

getAudioMute

getAudioMute(streamType: chrome.audio.StreamType): Promise<boolean>

Retrieves the system-wide mute state of the specified audio stream type.

setAudioActiveDevices

setAudioActiveDevices(ids?: chrome.audio.DeviceIdLists): Promise<void>

Sets the lists of active input and/or output devices.

setAudioMute

setAudioMute(streamType: chrome.audio.StreamType, isMuted: boolean): Promise<void>

Sets the mute state for the specified audio stream type.

setAudioProperties

setAudioProperties(id: string, properties?: chrome.audio.DeviceProperties): Promise<void>

Updates properties for the specified audio device.

onAudioDeviceListChanged

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

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

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.