Search code examples
javascripthtmlinput-devices

How to change audio input in Javascript


I'm developing a webRTC app, and I want to give users the ability to change their inputs devices (microphones).

I've found the way to display the available devices using navigator.mediaDevices.enumerateDevices() but i'm not able to find how to actually select one of the devices?

How can i set the input device to use in javascript?

Thanks.


Solution

  • You can accomplish this by following the example here: https://webrtc.github.io/samples/src/content/devices/input-output/