From Bright Pattern Documentation
< 5.19:AgentDesktop-client-side-javascript-api-specification
Revision as of 14:10, 16 September 2022 by Katherine (talk | contribs) (Created page with "<translate> =onAudioDeviceChange= Subscribe to any change of the user’s active audio device. ==Request== ''Syntax'' {| class="wikitable" |on('ON_AUDIO_DEVICE_CHANGE', han...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
• 5.19

<translate>

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)



</translate>

< Previous | Next >