MediaRecorder Audio Delay

Although there are a few questions about this stackonflowon thread and across the web, for example:

These links are from 2010 to 2013, while a final decision has not yet been found.

My situation looks like this:

  • User clicks the Record button
  • I'm starting a poll getMaxAmplitude ()
  • When the amplitude is greater than some value, say 5000, I launch my MediaRecorder. (functional requirement)
  • MediaRecorder records video and audio.
  • The user clicks the Stop Recording button, saving the output as a .mp4 file.

I expected MediaRecorder to record both video and audio at any time. Unfortunately, this is not the case.

As you can see from the first link, there is a delay, so the beginning is not recorded (which is the most important part of the record in my case). A possible solution would be to use AudioRecorder or RehearsalAudioRecorder. Unfortunately, they only record audio.

How can I confront this problem?

+5
source share

Source: https://habr.com/ru/post/1204012/


All Articles