Reputation: 4350
are there speed/performance differences between caf and mp3? Which format is better to use to play game sounds?
Upvotes: 4
Views: 1067
Reputation: 6205
From Core Audio Overview:
The following list describes how iOS supports audio formats for individual or multiple playback:
Linear PCM and IMA/ADPCM (IMA4) audio. You can play multiple linear PCM or IMA4 format sounds simultaneously in iOS without incurring CPU resource problems.
AAC, MP3, and Apple Lossless (ALAC) audio Playback for AAC, MP3, and Apple Lossless (ALAC) sounds uses efficient hardware-based decoding on iPhone and iPod touch. You can play only one such sound at a time.
So you probably should use PCM/ADPCM for sounds and AAC/MP3 for music.
Upvotes: 3
Reputation: 6372
Using MP3 formatted audio may result in pauses between your loops because they take some work to decompress. For games, where the sound needs to be instant, the processor needs to be working on game play, definitely go with the caf format.
Upvotes: 3