开发者

Mixing Audio on the iPhone

开发者 https://www.devze.com 2022-12-09 23:02 出处:网络
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)

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).

What shall I use? I know t开发者_开发问答here 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


I recommend you take a look at the some of the Apple documentation and sample code relating to reading files and mixing.

e.g. Mixing sample code

and Audio Queue Services sample code

and playing audio

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消