编辑音频/文件的重新录制一部分 [英] Editing audio / rerecording part of a file

查看:168
本文介绍了编辑音频/文件的重新录制一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望用户能够在一个应用程序录制音频,然后才能够选择该文件的一部分,并重新录制。例如,也许他们最初录制怎么现在,褐牛,然后选择,最终和重新录制皱眉母猪。这将合并到最初的文件,然后将怎么啦,皱眉母猪。

I want the user to be able to record audio in an app, and then to be able to select part of the file and rerecord it. For example, perhaps they initially record "How now, brown cow," then select the end of that and rerecord "frown sow." This would be merged into the initial file, which would then be "How now, frown sow."

这似乎是比我预想的要困难得多。我能做到这一点与3GP格式的文件?如果没有,我怎样才能将它们转换成我需要的格式?

This seems to be far more difficult than I expected. Can I do this with 3GP format files? If not, how can I convert them to the format I need?

我希望能够说借此刚刚录制的音频文件,它会从5秒填补这个其他媒体文件的10秒部分,现在保存新的,编辑的文件。我收集毫秒,框架,样品和字节之间的转换可以使这更加复杂。

I want to be able to say "take this just-recorded audio file. It will fill from the 5-second to the 10-second section of this other media file, now save the new, edited file." I gather converting between milliseconds, frames, samples and bytes could make this even more complicated.

我检查Ringdroid应用程序(我很感谢它是开源的!),其中至少有类似的功能,却是非常复杂的,很少在评论的方式...希望它比我需要的要复杂得多

I'm examining the Ringdroid app (I'm SO thankful it's open source!) which at least does something similar, but is very complicated with little in the way of comments... hopefully it's much more complicated than I need.

我没有看到这样的其他线程,但即使这是我所需要的,我不相信这些类是Android的一部分:的保存的音频文件(JAVA)

I did see this other thread, but even if it was what I needed, I don't believe those classes are a part of Android: Saving part of an audio file (Java)

推荐答案

我终于能够编辑3GP文件的部分。

I was finally able to edit parts of a 3GP file.

我用CheapAMR(这还管理3GP)和CheapSoundFile类从RingDroid,以及一个新的AudioFileHandler级。

I used the CheapAMR (which also manages 3GP) and CheapSoundFile classes from RingDroid, as well as a new "AudioFileHandler" class.

我学到沿途的一些重要的教训:

I learned some important lessons along the way:

  • 3GP文件分为拖曳。每个盒子包含一个值,说明箱子有多长,然后一些数据。有一个ftyp框用约3GP文件,一个的mdat盒与实际音乐数据,和一个MOOV框与电影数据(甚至仅音频文件具有该框的元数据。
  • 的档案盒中的顺序,以及它们各自的规模,从Android设备到Android设备更改
  • 音乐数据本身分为帧(在我的测试与3GP 32个字节,但我猜想这可能是不同的长度)。通过更换或添加一帧,从来没有通过编辑帧字节更改文件。
  • 在十六进制编辑器是非常有用的工具做这种编码时,
  • RingDroid有一些错误;它不准确地报告帧等的数量,所以黑客必须写入来解决此
  • 更改音频文件的长度时,一定要离开ftyp和MOOV盒不变,而改变四个字节立刻$文件P中$ pcedingMDAT。这种再presents以字节MDAT盒的长度,包括八个字节的mdat头本身的

这篇关于编辑音频/文件的重新录制一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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