为什么MediaRecorder延迟记录的开始? [英] Why is MediaRecorder delaying the start of recording?
问题描述
我已经实现了我的Android应用程序功能,使用 mediaRecorder
录制的音频文件。
它工作正常,但由于某些原因跳过记录的第一秒。
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.
我用完全相同的 code从开发者文档,所以我不明白为什么它会做到这一点。
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.
下面的是我的研究:
- 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?
我有一个LG的设备不知道它可能是一个硬件问题。
我也知道一些替代 mediaRecorder
,我只是想知道,如果有人找到一种方法来解决这个问题。
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.
推荐答案
的东西是 mediaRecorder
类是废话跟你说实话。
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.
此问题不能通过code被不客气,好像它是一个硬件问题。
This problem cannot be adressed through code, It seems like it is a hardware problem.
不幸的是一些设备将表现不同。
Unfortunately some device will behave differently.
的解决办法是使用 AudioRecorder
类,这是由灵活得多,因为它更接近硬件。不要浪费时间 mediaRecorder
!
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
!
这篇关于为什么MediaRecorder延迟记录的开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!