Hi John!
Well, have to say that since this my sound engine structure changed a lot. I realized that playing sound with AVAudioPlayer isn't the best way so now I'm using AVAudioPlayer to play music (in .mp3 format) and OpenAL to play sounds (which I convert to .caf files). There are some great OpenAL tutorials in the Apple page and also some examples on how to use it. For the sound files I recommend you to convert them to .caf, which I think it's iPhone best format for sounds. To convert them you can use the terminal and type:
Code:
afconvert -f caff -d LEI16@22050 -c 1 yourSound.wav yourSound.caf
Note function's parameters:
- LEI
16: This refers to sound Khz, so if you want your sound to have 32 Khz you must type 32 instead of 16.
- @
22050: This refers to bit rate, so in this example sounds are converted to 22050 bits, but you may want to convert them to 44100...
-
-c 1: This refers to the number of channels. Here I'm converting sounds to mono (because instead the user uses headphones a stereo sound is not appreciable with the iPhone and it just mean more file size so you may want to optimize it to prevent memory troubles...
And that's all I can say about this... AVAudioPlayer for music files in .mp3 format and OpenAL for sounds in .caf format!
Hope it helped!