views:

1163

answers:

2

I am trying to develop a simple iPhone app. I need to play sound within a loop. How can Play Audio file in loop without any interruption ?

A: 

I really don't know the iPhone SDK at all, but this should be quick: try making the sound itself looping. That way, you should be able to play it with just a single call, and won't need to worry about timing the repeat properly to restart it at the exact right moment.

For instance, WAV files have very flexible support for looping, and any decent audio editor should let you set looping points.

unwind
+2  A: 

Take a look at the new AVAudioPlayer class in the 2.2 release:

http://developer.apple.com/iphone/library/documentation/AVFoundation/Reference/AVAudioPlayerClassReference/Reference/Reference.html

It has functionality for looping sounds.

Frank Schmitt