xcode newbie
xcode newbie

Reputation: 59

Which audio types can loop without a gap in iOS?

I have heard, and tried myself, and it seems that .mp3's have a gap whenever you made to loop in iOS. Are there any audio types that don't have a gap when looped? Which ones?

Upvotes: 4

Views: 3634

Answers (4)

Dan Hixon
Dan Hixon

Reputation: 925

I struggled with this for a long time, tried converting to wav, tried using mp3 looper, nothing was working until I found that AAC can loop without gaps using AVAudioPlayer.

Upvotes: 1

iOS developer
iOS developer

Reputation: 317

You could use a wav, caf, aiff, or whatever, or you could process it first to make it work.

Upvotes: 0

coneybeare
coneybeare

Reputation: 33101

I loop mp3's seamlessly in my app Ambiance. You just have to process them before hand to alter the header info with the right amount. You can find out more about the process, and the easy encoding here

Other than mp3, you can loop any uncompressed audio such as wav, caf etc… Just ensure that the source is indeed a seamless loop.

Upvotes: 6

Mark Armstrong
Mark Armstrong

Reputation: 839

If you're using AVAudioPlayers, I would recommend using uncompressed .aiff or .wav files if you can get away with the file size. If file size is an issue, an m4a wrapped as a .caf file would be your best bet. But you're right, MP3s just don't loop seamlessly with AVAudioPlayers.

Upvotes: 2

Related Questions