# audio
Documentation: [Chrome Audio API](https://developer.chrome.com/docs/extensions/reference/audio)
A promise-based wrapper for the Chrome `audio` API.
## Methods
- [getAudioDevices(filter?)](#getAudioDevices)
- [getAudioMute(streamType)](#getAudioMute)
- [setAudioActiveDevices(ids?)](#setAudioActiveDevices)
- [setAudioMute(streamType, isMuted)](#setAudioMute)
- [setAudioProperties(id, properties?)](#setAudioProperties)
## Events
- [onAudioDeviceListChanged(callback)](#onAudioDeviceListChanged)
- [onAudioLevelChanged(callback)](#onAudioLevelChanged)
- [onAudioMuteChanged(callback)](#onAudioMuteChanged)
---
### getAudioDevices
```
getAudioDevices(filter?: chrome.audio.DeviceFilter): Promise
```
Retrieves the list of available audio devices, optionally filtered.
### getAudioMute
```
getAudioMute(streamType: chrome.audio.StreamType): Promise
```
Retrieves the system-wide mute state of the specified audio stream type.
### setAudioActiveDevices
```
setAudioActiveDevices(ids?: chrome.audio.DeviceIdLists): Promise
```
Sets the lists of active input and/or output devices.
### setAudioMute
```
setAudioMute(streamType: chrome.audio.StreamType, isMuted: boolean): Promise
```
Sets the mute state for the specified audio stream type.
### setAudioProperties
```
setAudioProperties(id: string, properties?: chrome.audio.DeviceProperties): Promise
```
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.