SQUASHED – Jesse Harlin (December 2008)

iPhone compression options for music 

THE CASUAL GAMES MARKET CONTINUES to boom, and with it come enormous leaps in mobile gaming technology. Apple’s iPhone is now one of the most popular mobile gaming devices and has turned into yet another SKU that audio content creators may need to support in a multi-platform development cycle.

iPhone games, due to a 2GB maximum size limit, require an intelligent approach to audio footprint management. Thankfully, the iPhone supports a wide array of audio formats including Linear PCM, MP3, AAC, Apple Lossless, IMA/ADPCM, A-law, μ-Law, AMR, and iLBC. The iPhone also supports Audible.com’s audible formats 2, 3, and 4. However, as they are a proprietary format with proprietary encoding technology, these options aren’t available for game development. Noticeably missing, unfortunately, is the ogg vorbis format.

Music files are most likely to be the largest audio files in an iPhone game, so compression formats become that much more important. With so many options available, I decided to take a sample file, convert it into each of the available formats, and compare the results in order to find out which format offers the highest quality at the smallest size.


For my control music file, I used a 44.1 kHz/16-bit .WAV file with a length of 30 seconds and a size of 5MB. Additionally, the file was authored so as to loop seamlessly from end to end upon playback. Following the conversion process, the largest files were the A-law and μ-Law files, both of which compressed with a 2:1 ratio down to 2.52MB. To encode the A- and μ-Law files within Peak, the source file needed to be converted into an .AIF file. On the positive side, following compression, both the A- and μ-Law files retained their seamless loop points perfectly. However, there was a noticeably loud continuous crackle of compression artifacts which seriously degraded the sonic quality of both files.

The next smallest compressed file used Apple’s own Apple Lossless Audio Codec (or ALAC). A number of programs will convert into Apple Lossless such as dBpoweramp Music Converter or SoundConverter, but by far the easiest to use and most common program is a free download of iTunes. Apple Lossless compressed the source file down to 2.39MB and maintained the seamless loop while offering no audible degradation in sound quality.
Much like the A-law and μ-Law files, the IMA/ADPCM conversion within Peak necessitated a conversion to .AIF. Following conversion, the IMA/ADPCM file also retained a seamless end-to-end loop but had a much smaller file size than A-Law, μ- Law, or ALAC files with a decrease in its file size down to 1.35MB. While I didn’t hear any noticeable change in the quality of the audio, it may be worth noting that the audio file was actually 8 samples longer after conversion into IMA/ADPCM.
For Apple’s own AAC format, I again tackled the conversion process within iTunes which gave me two different quality settings: 128 kbps or 256 kbps. The quality of both was decent with even the 128 kbps file showing little difference from the source .WAV, even though some clarity was noticeably lost particularly in higher frequencies. The 256 kbps file compressed down to 950k while the 128 kbps file shrunk to an impressive 480k. However, conversion to AAC destroyed the seamless loop with an additional 3080 samples of silence tacked onto the end of the file in both instances as the conversion goes through a process of rounding the data up to the nearest frame boundary.

To test the .MP3 format, I again used iTunes for the conversion and compared two different quality settings: 192 kbps and again 128 kbps. While both files were smaller than the AAC files—707k and 472k, respectively—the same need to round up to the nearest frame boundary resulted in an additional 1764 samples of silence added onto the end of both files and an audible skip in the loop point. Sonically, the compression was beginning to take its toll and while the 192 kbps file sounded better than the 128 kbps file, neither sounded as good as the 128 kbps AAC file.

Lastly, since I was interested in figuring out what would have the smallest size but also the greatest quality, I decided to not test the iLBC or AMR file formats. The iLBC, or internet Low Bit-Rate Codec, is a format specifically designed for streaming speech online with a set quality level of 8 kHz/16-bit audio. AMR, or Adaptive Multi-Rate compression, is the standardized speech codec in the cellphone industry and uses a set quality level of 8 kHz/13-bit audio.


Of the larger files, with a serious degradation in audio quality and the worst compression ratio of all of the options, both A- and μ-Law are easily ruled out. Apple Lossless sounds excellent along side the original file and maintains the loop point cleanly, but doesn’t save much in terms of file size. IMA/ADPCM compression sounds great and maintains the loop cleanly, but may not compress files enough if you’re using multiple music files within the game.

As for the smaller files, AAC definitely outperforms MP3 compression—even at 128 kbps. However, both formats will require additional programming support to help skirt the issue of frame boundary limitations and the additional silence this adds onto the end of each file if music files are intended to loop.

Leave a Reply

You must be logged in to post a comment.