From Bright Pattern Documentation
< 5.19:AgentDesktop-client-side-javascript-api-specification
Revision as of 04:01, 29 May 2024 by BpDeeplTranslateMaintenance (talk | contribs) (Updated via BpDeleteTranslateTags script)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
• 5.19


onAudioDeviceChange

Subscribe to any change of the user’s active audio device.

Request

Syntax

on('ON_AUDIO_DEVICE_CHANGE', handler: OnAudioDeviceChangeHandler): void


type OnAudioDeviceChangeHandler = (inputDevice?: string, outputDevice?: string) => SyncAsyncResult

Parameters

Parameter Parameter Values Data Type Optional/Required Description
inputDevice String Optional The system name of the input device (i.e., microphone)
outputDevice String Optional The system name of the output device (i.e., headset)

Example Request

function audioDeviceChangeCallback(input?: string, output?: string) {

console.log("New microphone:", input);

console.log("New headset:", output);

}

adApi.on("ON_AUDIO_DEVICE_CHANGE", audioDeviceChangeCallback);

Return Value

(None)

< Previous | Next >