在iPhone上的混合音频 [英] Mixing Audio on the iPhone
问题描述
我有一些,我希望能够动态地混合在一起,并在iPhone上(而不是一次全部,最常见的情况是将两个或三个音频流混合到一个数据流)静态播放音频文件。
I have a number of static audio files that I want to be able to dynamically mix together and play on the iPhone (not all at once, most common case is to mix two or three audio streams into one stream).
我应该使用?我知道有OpenAL的和音频单元,可能是有用的,但哪一个?
为了得到一个踢启动,是有如何做到这一点的地方的具体code段?
What shall I use? I know there are OpenAL and Audio Units that could be useful, but which one? To get a kick-start, is there a concrete code snippet for how to do this somewhere?
在此先感谢,
/史蒂夫
Thanks in advance, /Steve
推荐答案
我建议你看一看在一些与读取文件和混合苹果的文档和示例code的。
I recommend you take a look at the some of the Apple documentation and sample code relating to reading files and mixing.
例如。 <一href=\"http://developer.apple.com/iphone/library/sample$c$c/iPhoneMultichannelMixerTest/index.html\">Mixing样品code
和<一个href=\"http://developer.apple.com/iphone/library/documentation/MusicAudio/Conceptual/AudioQueueProgrammingGuide/AQPlayback/PlayingAudio.html#//apple%5Fref/doc/uid/TP40005343-CH3-SW1\">playing音频
对于更高级别的API,使用<一个href=\"http://developer.apple.com/iphone/library/documentation/MusicAudio/Reference/AudioQueueReference/Reference/reference.html\">AudioQueueServices它做了很多缓冲的你,但如果你需要有最大的控制和flexbility,那么我建议用AudioFileReadPackets沿着AudioUnit这是<一部分href=\"http://developer.apple.com/iphone/library/documentation/MusicAudio/Reference/AudioFileConvertRef/Reference/reference.html\">AudioFileServices
For a higher level API, use AudioQueueServices which does a lot of the buffering for you, but if you need to have maximum control and flexbility, then I suggest an AudioUnit along with AudioFileReadPackets which is part of AudioFileServices
希望帮助,
本。
Hope that helps, Ben.
这篇关于在iPhone上的混合音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!