Switch Microphone
When you have multiple sound devices, you can choose to use one of them.
//Create a list of usable microphone devices on the menu
const audioSelect = await arctosSdkInstance.$meetingRoom.getAudioDevices();
audioSelect.forEach(element => {
var option = document.createElement("option");
option.text = element.label;
option.value = element.deviceId;
document.querySelector('#switch-audio-select').appendChild(option);
});
Click the select menu to switch devices.
//Select microphone to use
SwitchAudio = async function (e) {
let val = document.querySelector('#switch-audio-select').value;
arctosSdkInstance.$meetingRoom.setAudioDevice(val);
};
Toggle the user's microphone in the room on or off.
//Toggle the microphone on or off
toggleAudioClick = async function () {
arctosSdkInstance.$meetingRoom.toggleAudio();
};
The following url is a sample code for switch the microphone.