iPhone 上的实时音调变换
我正在编写一个儿童 iPhone 应用程序,我需要能够使用 Core Audio 改变声音样本的音调。有谁有任何示例代码我可以看看这是在哪里完成的。应用程序商店中有许多音乐和游戏应用程序可以执行此操作,所以我知道我不是第一个。但是,我找不到任何这样做的例子。
I have a children's iPhone application that I am writing and I need to be able to shift the pitch of a sound sample using Core Audio. Does anyone have any example code I could look at where this is done. There are many music and game apps in the app store that do this so I know I am not the first one. However, I cannot find any examples of it being done.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以使用 dsp 维度中的 dirac-2 在 iPhone 上进行音高变换。引用: -
“DIRAC2 既可以作为提供无限采样率和锁相多通道支持的商业对象库,也可以作为免费的单通道 44.1/48kHz LE 版本。”
you can use dirac-2 from dsp dimension for pitch shifting on the iphone. quote: -
"DIRAC2 is available as both a commercial object library offering unlimited sample rates and phase locked multichannel support and as a free single channel, 44.1/48kHz LE version."
使用 soundtouch 开源项目来改变音高
这是链接: http://www.surina.net/soundtouch/
将 soundtouch 添加到项目后,您必须将输入声音文件路径、输出声音文件路径和音高变化作为输入。
由于处理声音需要更多时间,因此最好修改 soundtouch,以便在录制语音时直接提供数据进行处理。这会让你的申请变得更好。
use the soundtouch open source project to change pitch
Here is the link : http://www.surina.net/soundtouch/
Once you add soundtouch to your project, you have to give the input sound file path, output sound file path and pitch change as the input.
Since it takes more time to process your sound its better to modify soundtouch so that when you record the voice, directly give the data for processing. It will make your application better.
我知道对于提出问题的人来说已经太晚了,但对于任何正在寻找同一问题解决方案的其他人来说,这确实是一个有价值的链接(正如我发现的)。
所以这里我们有最新的 DIRAC3 及其自己的 音频播放器 类,它将处理运行时音调和速度(探索天知道更多)变化。运行示例并为此赢得热烈的掌声。
I know it's too late for the person who asked but it is really a valuable link (As I found) for any one else who is looking for the solution of the same problem.
So Here we have latest DIRAC3 with it's own audio player classes which will take care of run time pitch and speed(explore for god knows what more) shifting. Run the sample and have huge round of applause for that.
尝试 Dirac - 这是目前最好的技术,并且可在 Win、Linux、MacOS X 和 iOS 上使用。我们在所有产品中都使用它(其他一些产品也这样做,在 App Store 上搜索“Capo”)。它们现在处于版本 3,与之前的版本相比,性能有了巨大的提高。希望这有帮助。
Try Dirac - it's the best technology out there and it's available on Win, Linux, MacOS X and iOS. We're using it in all our products (and a couple of others do as well, search for "Capo" on the App Store). They're at version 3 now which has seen a huge increase in performance since previous versions. Hope this helps.
请参阅:相关问题
您需要多少程度的音调控制...你能预先计算出所有不同的声音吗?
如果答案是肯定的,那么您只需选择正确的声音并播放它们即可。
您还可以将音频转换器服务与 AVAudioPlayer 结合使用,这将允许您重新采样音频(这将有效地重新调整它们,尽管它们会改变持续时间)。
或者,正如相关问题指出的那样,您可以使用 OpenAL 和 AL_PITCH
See: Related question
How much control over pitch do you need... could you precalculate all the different sounds?
If the answer is yes, then you can just pick the right sounds and play them.
You could also use Audio Converter Services in conjunction with AVAudioPlayer, which will allow you to resample the audio (which will effectively repitch them, though they'll change duration).
Alternatively, as the related question points out, you could use OpenAL and AL_PITCH