getUserMedia() Audio not streaming in some cases

Hello guys,
I am recording a short video of 10 Sec in my project using navigator.mediaDevices.getUserMedia({ video: true, audio: true })

In development the app is working good and i am able to record and store all the videos efficiently,
After moving it to production, it is also working as expected,
but what is happening is that in some 20% around cases, the video recorded from customer has no audio at all.
I have also put checks whether mic is enabled and audio is not mute.

I have gone through what additional parameters which could be assigned in the constraints as well.

Can anyone please suggest what am i missing here in audio recording part?

Is there any way to check whether the audio is streaming while recording it going on or force audio recording with active mic?

Thank You for your time :slight_smile:

It is difficult to say why it is not working in 20% of the cases without checking the code and the logs.
A good practice before recording is to introduce a mic / camera checking screen where a user can check for himself / herself if both camera and mic are working or not. Let the user proceed to the recording screen if both camera and mic are working properly else show an error. There are techniques to check the audio volume using the inbuilt audio gainnode API available in the browser. You can use this to detect if there is enough volume in the mic to record the audio or not!
Also the 20% can be cases where there is only 1 available mic and it is busy with another video conferencing application. In this case there is not much to do without waiting for the mic to be available.

I hope this helps.