简体   繁体   English

iPhone - 任何操纵录制音频的方法?

[英]iphone - any way to manipulate recorded audio?

Specifically, I just want to record something, reverse it, and play it back. 具体来说,我只想记录一些内容,将其反转并播放。 I've looked through the apple docs and couldn't find anything about editing audio. 我查看了苹果文档,找不到有关编辑音频的任何信息。 Is it possible? 可能吗?

Yes, it is definitely possible. 是的,这绝对是可能的。 Last I checked the Apple Core Audio docs were not very good, but it has been a few months since I've worked with it. 最后我检查了Apple Core Audio的文档并不是很好,但是自从我使用它以来已经有几个月了。 Here are the steps that I would follow. 以下是我将遵循的步骤。

  1. Record the audio sample. 录制音频样本。

  2. Reverse the audio by looping through the first half of the array and swapping the value located there with one an equidistant from the end of the array. 通过循环遍历数组的前半部分来反转音频,并交换位于那里的值,其中一个值与数组的末端等距离。

  3. Play the resulting audio clip. 播放生成的音频片段。

Quite frankly, the first step is probably the hardest. 坦率地说,第一步可能是最难的。 Here is a decent article about doing audio on the iPhone including recording. 是一篇关于在iPhone上录音的好文章,包括录音。 Make sure you look at all of the different parts of the article. 请务必查看文章的所有不同部分。 Here is another article about recording sound on the iPhone, but using a different framework. 是另一篇关于在iPhone上录制声音但使用不同框架的文章。 There are really several ways to go about recording on the iPhone though, last I checked, if you want to play audio while you are recording you have to use RemoteIO. 有几种方法可以在iPhone上进行录制,最后我查了一下,如果你想在录制时播放音频,你必须使用RemoteIO。

Edit: 编辑:

If you would like to use RemoteIO(which I preferred), then this site is pretty helpful for getting started with it. 如果您想使用RemoteIO(我更喜欢),那么这个网站对于开始使用它非常有帮助。 Also, the aurioTouch sample program that Apple provides is immensely helpful (though more than you want). 此外,Apple提供的aurioTouch示例程序非常有用(尽管比您想要的更多)。

If you don't need RemoteIO (because it can be a major pain though it is more low-level and thus more flexible), then try the SpeakHere sample program. 如果你不需要RemoteIO(因为它可能是一个主要的痛苦,虽然它更低级,因此更灵活),然后尝试SpeakHere示例程序。 It is made just to record and play back. 它只是为了录制和播放。 However, I just looked at it and it writes the recording to a file rather than a buffer which isn't what you want. 但是,我只是看着它,它将录音写入文件而不是缓冲区,这不是你想要的。 I would recommend going with RemoteIO for that reason (unless you can find a way to have it write to a buffer instead). 因为这个原因,我建议使用RemoteIO(除非你能找到一种方法让它写入缓冲区)。

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

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