Reputation: 2180
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 ?
Upvotes: 1
Views: 4639
Reputation: 555
The AVAudioPlayer has numberOfLoops property where you can specify the number of times you want the audio to loop.
Upvotes: 0
Reputation: 25765
Take a look at the new AVAudioPlayer class in the 2.2 release:
It has functionality for looping sounds.
Upvotes: 5
Reputation: 399793
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.
Upvotes: 1