Question

I have implemented a feature in my android app that records an audio file using mediaRecorder. It works fine but for some reasons skips the the first second of recording.

I used the exact same code from the developer documentation so I don't understand why it would do that.

I looked for an answer to this issue, I found few people with the same issue, but no real solution.

Here's is my research:

I have an LG device not sure if it could be a hardware issue. I am also aware of some alternatives to mediaRecorder, I just want to know if someone found a way to solve this.

Was it helpful?

Solution

The thing is the mediaRecorder class is crap to be honest with you.

If you are experiencing the same issue, with a small silence or dead air, you dont have many option.

This problem cannot be adressed through code, It seems like it is a hardware problem.

Unfortunately some device will behave differently.

The Solution is to use the AudioRecorder class which is by far more flexible since it is closer to the hardware. Don't waste time with mediaRecorder !

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top