The mediaRecorder class mediaRecorder is shit to be honest with you.
If you are faced with the same problem, with a little silence or dead air, you do not have many options.
This problem cannot be addressed through code. This seems to be a hardware issue.
Unfortunately, some device will behave differently.
The solution is to use the AudioRecorder class, which is much more flexible as it is closer to the hardware. Do not waste time on mediaRecorder !
source share