Title
Speaker device is used as an output audio device on local machine.
As it is shown in Retrieving And Using Media Device Lists tutorial, Speaker device can be acquired from
MultimediaController.speakerList property. Acquired Speaker device can then be set as an active
speaker device through MultimediaController.selectSpeaker method, as it is shown in the snippet below:
// In this example it is assumed, that used index is valid
var speaker = cwic.MultimediaController.speakerList[0];
cwic.MultimediaController.selectSpeaker(speaker);
Setting new speaker device as active will trigger
"onMediaDeviceListChanged" event.
Volume Control (Windows OS Only)
Volume control is supported only on Windows OS. Speaker's output volume level can be set through Speaker.setVolume
method. Current output volume level can be read from Speaker.volume property. In the snippet bellow it is demonstrated
how to retrieve and set speaker's output volume level:
// In this example it is assumed, that used index is valid
var speaker = cwic.MultimediaController.speakerList[0];
// Current speaker's output volume level.
var currentVolume = speaker.volume;
// Setting new speaker's output volume level to 50 (0-100 accepted values)
speaker.setVolume(50);