简体   繁体   English

我们如何在Android 4.0中实现录音暂停/恢复功能

[英]How Can we achieve audio recording pause/resume functionality in android 4.0

I am working on one small android application.With in that I have a requirement like audio recording with pause and resume options.I searched a lot in the Google,but I couldn't get anything related to that. 我正在研究一个小的Android应用程序。因为我有一个像带有暂停和恢复选项的录音的要求。我在谷歌搜索了很多,但我无法得到任何相关的东西。

Somebody said that there is no default pause and resume functionality in android. 有人说android中没有默认的暂停和恢复功能。

If you want that ,"you need to save that recorded audio file while click on pause button and save into your SD card.And you need to start again from the beginning when you click on resume button.At lost If you want to upload ,then you need to merge all the recorded files as one file then upload it". 如果你想要,“你需要保存录制的音频文件,同时点击暂停按钮并保存到你的SD卡。当你点击恢复按钮时,你需要从头开始。失去如果你想上传,然后你需要将所有录制的文件合并为一个文件然后上传“。

I followed his suggestion,but there is no such related code for merging audio files of m4a format available in java/android. 我按照他的建议,但没有相关的代码来合并java / android中可用的m4a格式的音频文件。

Can anyone suggest me on this. 任何人都可以建议我这个。

yes that's correct android audio recorder don't support pause you need to stop and start this and merge all the files together to create a recording 是的,正确的Android录音机不支持暂停,您需要停止并启动它并将所有文件合并在一起以创建录音

You need to use the audiorecorder class the good example is here Android : recording audio using audiorecord class play as fast forwarded 您需要使用audiorecorder类,这里的好例子是Android:使用audiorecord类播放录制音频作为快进

and you need to merge them as demostrated here 你需要在这里将它们合并为demostrated

Merging pcm audio files 合并pcm音频文件

Hope this helps 希望这可以帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM