Audio

Audio

Control Audio devices attached to your device.

Members

DeviceType :DeviceTypes

StreamType :StreamTypes

Methods

(async) getDevices(filteropt) → {Promise.<Array.<module:Audio~AudioDevice>>}

Enumerate the available devices.

Parameters:
Name Type Attributes Default Description
filter Filter <optional>
{}

The filter to apply to the query.

(async) getMute(streamType) → {Promise.<boolean>}

Get the mute state of a stream.

Parameters:
Name Type Description
streamType StreamTypes

The type of stream to get the mute state of.

onDeviceListChanged(callback)

Event raised when the list of available audio devices is changed.

Parameters:
Name Type Description
callback function

Called when the list of available audio devices has changed.

Listens to Events:
  • event:deviceListChanged

onLevelChanged(callback)

Event raised when the audio level of an audio device is changed.

Parameters:
Name Type Description
callback function

Called when the audio level of an audio device is changed.

Listens to Events:
  • event:levelChanged

onMuteChanged(callback)

Event raised when the mute state of an audio device is changed.

Parameters:
Name Type Description
callback function

Called when the mute state of an audio device is changed.

Listens to Events:
  • event:muteChanged

(async) setActiveDevices(devicesopt) → {Promise}

Set the active audio devices.

Parameters:
Name Type Attributes Default Description
devices DeviceIdLists | Array.<module:Audio~InputDeviceList> | Array.<module:Audio~OutputDeviceList> <optional>
[]

A list of devices to set as active

(async) setMute(streamType, isMuted) → {Promise}

Set the mute state of a stream.

Parameters:
Name Type Description
streamType StreamTypes

The type of the stream to set the mute state on.

isMuted boolean

Whether or not the stream is muted (muted=true, unmuted=false)

(async) setProperties(id, properties) → {Promise}

Set the properties of an audio device.

Parameters:
Name Type Description
id string

The id of the device to set the properties of.

properties AudioDeviceProperties

The properties to set.