MediaRecorder 类在稍微延迟后开始录制音频 [英] MediaRecorder class starts recording audio after slight delay

查看:56
本文介绍了MediaRecorder 类在稍微延迟后开始录制音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了 MediaRecorder 类的问题.当我调用 start() 方法时,录音机开始录制(音频)但经过一些延迟(延迟非常明显 - 大约 1 秒).我在 Android 2.3 设备上看到过这种情况,特别是三星 Nexus S.这个问题不会出现在 Android 1.6 (G1) 或任何版本的 Android 模拟器上.您能否确认您是否看到此问题以及是否存在相同的解决方案?这是记录在案的错误吗?

I am having an issue with the MediaRecorder class. When I call the start() method, the recorder starts recording(audio) but after some delay (The delay is quite noticeable - approximately 1 second). I have seen this happening on Android 2.3 devices, specifically Samsung Nexus S. This issue does not appear on Android 1.6 (G1) or any version of Android emulators. Could you please confirm if you are seeing this issue and if there exists a solution for the same? Is this a documented bug?

推荐答案

这似乎是 MediaRecorder 或设备固件中的错误.您可以在同样使用 MediaRecorder 的默认相机应用程序中看到相同的延迟.我还注意到每次录制结束时都有额外的音频,超过了视频停止录制的时间.然而,视频和音频似乎在整个视频中同步.是这样的:

This seems to be either a bug in either MediaRecorder or the device's firmware. You can see the same delay in the default Camera app, which also uses MediaRecorder. I also noticed that there's extra audio at the end of each recording, past when the video stops recording. However, the video and audio seem to be synched throughout the video. It's something like this:

   =========================================     Audio being captured
=========================================        Video being captured
|----|----|----|----|----|----|----|----|----|   Time
^                                       ^
start()                               stop()

所以音频并没有真正移动",它只是在视频捕获之后开始和结束.

So the audio isn't really "shifted", it just begins and ends past the video capture.

我看到运行 Honeycomb (Android 3.0) 的摩托罗拉 Xoom 平板电脑出现延迟.

I'm witnessing the delay on a Motorola Xoom tablet running Honeycomb (Android 3.0).

在此处查看错误报告:http://code.google.com/p/android/issues/detail?id=15953

这篇关于MediaRecorder 类在稍微延迟后开始录制音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆