开发者

why did MediaRecorder delay to record audio

开发者 https://www.devze.com 2023-02-20 07:14 出处:网络
I use a MediaRecorder to start record audio, and at the same start a TimerTask scheduleAtFixedRate(doRecordingTimer, 0, 1000); and a Handler to update UI showing the time has passed.

I use a MediaRecorder to start record audio, and at the same start a TimerTask scheduleAtFixedRate(doRecordingTimer, 0, 1000); and a Handler to update UI showing the time has passed.

Here comes the problem: When the UI shows 10 seconds(just for an example) have passed, and I stop recording, start playing the file, but it just shows as a 4 seconds long audio file.

Why does this开发者_如何学C happen? I can be sure the time on the UI is correct, so what cause the MediaRecorder to delay?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号