简体   繁体   English

合并多个 mp4 音频文件 - Android

[英]Merging multiple mp4 audio files - Android

I am trying to make an audio recorder feature for my app which supports pausing/resuming recording.我正在尝试为我的应用程序制作一个支持暂停/恢复录音的录音机功能。 At the end, when the user hits save, i only want 1 file.最后,当用户点击保存时,我只想要 1 个文件。 In android, mediarecorder doesn't support pause and write to a new file each time its initiated.在android中,mediarecorder不支持每次启动时暂停和写入新文件。

Currently im using mp4parser to merge the files but it takes a very long time (11-20 mins) to merge a 2min with 20min file.目前我使用 mp4parser 来合并文件,但合并 2 分钟和 20 分钟的文件需要很长时间(11-20 分钟)。

Are there any alternatives?有没有其他选择? The files are in mp4 format.文件为 mp4 格式。

MediaCodec and MediaMuxer. MediaCodec 和 MediaMuxer。 Once you have encoded m4a samples you can store them or pass to muxer to write into file.一旦你编码了 m4a 样本,你就可以存储它们或传递给 muxer 以写入文件。 Since both codec and muxer are working in different threads and carrying asynchronous nature you can stop ("pause") feeding samples and continue when you need too.由于编解码器和多路复用器都在不同的线程中工作并具有异步性质,因此您可以停止(“暂停”)提供样本并在需要时继续。

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

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