Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Use the interfaces in Audio Queue Services (AudioToolbox/AudioQueue.h). Create one audio queue object for each sound that you want to play. Then specify simultaneous start times for the first audio buffer in each audio queue, using the AudioQueueEnqueueBufferWithParameters function.</p> <p>The following limitations pertain for simultaneous sounds in iPhone OS, depending on the audio data format:</p> <p>AAC, MP3, and ALAC (Apple Lossless) audio: You may play multiple AAC, MP3, and ALAC format sounds simultaneously; playback of multiple sounds of these formats will require CPU resources for decoding.</p> <p>Linear PCM and IMA/ADPCM (IMA4 audio): You can play multiple linear PCM or IMA4 format sounds simultaneously without CPU resource concerns.</p> <p>In terms of playing multiple sounds at once, that's easy, just create a new player instance for every one that you want to play (and remember to release them when you're done)</p> <pre><code> NSString *path = [[NSBundle mainBundle] pathForResource:@"YOUR_FILE_NAME" ofType:@"m4a"]; AVAudioPlayer* objAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; objAudio.delegate = self; [objAudio play]; </code></pre> <p>To convert an MP3 into something like IMA4 (which you can play more than one at once) you would run the following (in terminal, in leopard):</p> <pre><code> /usr/bin/afconvert -f caff -d ima4 sound.mp3 sound.caf </code></pre> <p>for More information, visit <a href="http://developer.apple.com/library/ios/#codinghowtos/AudioAndVideo/index.html" rel="noreferrer">Audio Play/Record</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload