Md Nasir Uddin
Md Nasir Uddin

Reputation: 2180

How can Play Audio file in loop without any interruption?

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

Answers (3)

Siddharth
Siddharth

Reputation: 555

The AVAudioPlayer has numberOfLoops property where you can specify the number of times you want the audio to loop.

Upvotes: 0

Frank Schmitt
Frank Schmitt

Reputation: 25765

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.

Upvotes: 5

unwind
unwind

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

Related Questions