Is there a way to change the default microphone of a client based on user selection? I can obtain the list of devices using the enumerateDevices promise, but how can 'Audio 40 USB' be set as the default microphone in this scenario?
navigator.mediaDevices.enumerateDevices().then(devices => {
for (let i = 0; i < devices.length; i++) {
if (devices[i].kind === "audioinput" && devices[i].label.includes('Audio 40 USB')) {
//devices[i].deviceId ='default'; // make this devaice into default microphone
// break;
}
}
});
I believe I may have found the solution for setting the default:
audio: {deviceId: audioSource ? {exact: audioSource} : undefined}