Why does MediaRecorder delay the start of recording?

I have implemented a function in my Android application that records an audio file using mediaRecorder . It works fine, but for some reason skips the first second of recording.

I used the same code from the developer documentation , so I don’t understand why he did it.

I was looking for the answer to this question, I found few people with the same problem, but there was no real solution.

Here are my studies:

I have an LG device, not sure if this could be a hardware problem. I also know some alternatives to mediaRecorder , I just want to know if anyone has found a way to solve this problem.

+2
source share
1 answer

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 !

+3
source

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


All Articles