> If we run navigator.mediaDevices.enumerateDevices() the audio device returned as default is not the one selected, but the one selected as default in the OS.
The user can any real, or virtual, or remapped device they want as default, locally. Doesn't even have to be a microphone. The default device for a microphone could be speakers, or "What-U-Hear". So just selecting default device for every user might not be ideal.
> Question is: how can we make sure we select the microphone selected in the site setting when calling getUserMedia with the device id?
Just handle whatever device the user selected. Give written notice to users to select a microphone device, if that is what your application expects.