A lot of people are recommending using
AudioServicesCreateSystemSoundID for playing short sounds on the iPhone. I think even the official SDK documentation recommends this for sounds that are just a few seconds long.
There are a couple of problems with this that you might want to consider:
- You cannot control the volume of the sound. As far as I can tell there is no function in the API to let you do this.
- When you have your phone set to vibrate, the sounds will not play, even when headphones are plugged in. This is in contrast to using
AVAudioPlayerand the like which will play sounds through the headphones in vibrate mode.
So I guess using the
AudioServicesCreateSystemSoundID approach only really applies for 'alert' sounds or sounds that are not crucial to your app.