2

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.

Community
  • 1
  • 1
meda
  • 45,103
  • 14
  • 92
  • 122
  • Regarding silence at the beginning of recordings; on at least some devices I've worked with that was done to avoid garbage samples at the beginning due to reading from the microphone too soon after enabling the mic's voltage regulator. This silence didn't last for anywhere near a second though, IIRC, so you might be looking at a different issue. – Michael Nov 13 '13 at 07:05

1 Answers1

5

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 !

meda
  • 45,103
  • 14
  • 92
  • 122