Why is MediaRecorder delaying the start of recording?

杀马特。学长 韩版系。学妹 提交于 2019-12-12 22:23:26

问题


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:

  • MediaRecorder class starts recording audio after slight delay
  • MediaRecorder Silence at Beginning of Recording (Delay?)
  • MediaRecorder starts with a 1 sec delay. How do I get rid of the silence?

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.


回答1:


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 !



来源:https://stackoverflow.com/questions/19937740/why-is-mediarecorder-delaying-the-start-of-recording

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!