I see this error `cannot switch audio output, the ...
# ask-ai
a
I see this error
cannot switch audio output, the current browser does not support it
I think it comes from
setActiveMediaDevice
t
Thanks for reaching out, Anne. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! That error
cannot switch audio output, the current browser does not support it
pops up when your browser doesn’t support the feature needed to switch audio output devices. This usually happens because some browsers, like Safari and those on iOS, don’t fully support the
setSinkId
method. Here are a few things you can try to fix it: • Enable WebAudio Mix: You can turn on the
webAudioMix
option in your room configuration to help with compatibility:
Copy code
const room = new Room({
  webAudioMix: true
});
• Browser Detection: It’s a good idea to detect the browser and handle unsupported ones smoothly. For example:
Copy code
import { getBrowser } from 'livekit-client';

const browser = getBrowser();
if (kind === 'audiooutput' && (browser?.name === 'Safari' || browser?.os === 'iOS')) {
  console.warn('Audio output switching not supported on this browser');
  return;
}
• Feature Detection: Before trying to switch audio output, check if the
setSinkId
method exists:
Copy code
if ('setSinkId' in HTMLMediaElement.prototype) {
  await room.switchActiveDevice('audiooutput', deviceId);
} else {
  console.warn('Audio output switching not supported on this browser');
}
If you want, I’m here to help with implementing any of these—just let me know! Sources: packages/react/src/components/controls/MediaDeviceSelect.tsx | README.md