Apple has an article on this: this link
AVAudioPlayer is the easiest way to play sounds of any length, loop or not, but it requires iPhone OS 2.2 or higher. A simple example:
NSString *soundFilePath =
[[NSBundle mainBundle] pathForResource: @"sound"
ofType: @"wav"];
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];
AVAudioPlayer *newPlayer =
[[AVAudioPlayer alloc] initWithContentsOfURL: fileURL
error: nil];
[fileURL release];
[newPlayer play];
[newPlayer release];
It will play almost any file format (aiff, wav, mp3, aac). Remember that you can only play one mp3 / aac file at a time.
source
share