In the last year, I have created audio and music on around 8 unique titles for various iOS / mobile hobbyist developers. In that time, I have honed and refined my audio creation delivery to keep file sizes small through a great deal of trial and error. And now, I will share my processes with you, dear reader, in the hope that they are of some use to you.

[Note: I always tailor mobile audio to the speaker and not the headphones, as I believe that the majority of users will not use headphones for games]


Re-assess your creative approach

The first title I worked on for iOS was a simple ‘Match-3′ puzzle game using coloured orbs. This inspired me to write music that was tonal and soothing, using bell/chime-like sounds as the basis of my compositional palette. Click the link below for an example:

Orbs Match; Chime audio example

iPhone specs (Note: The compatible file formats weren’t listed on this page when I viewed them for iPhone 3! If they had this would have been a short post.), raised my eyebrow at the claims of 20Hz – 20Khz frequency range and, without an iOS device of my own at this point) estimated what the practical range was.

My initial estimate was wrong. My beautiful chime sound would be the cause of a lovely little issue called inter-modular distortion, that was being caused by the way I had created the sound (layering multiple sine waves of varying frequencies), all of which were clustered around the iPhone speaker lower audible frequency threshold of 400Hz.

The result was a terrible distortion that not only ruined the low-mid range of my music tracks, but also of the sound effects I had created based on that sound.

I eventually resolved this by stripping back the detail of synthesised sound, thus removing the number of potential harmonics to distort the speaker. This is the version heard in the link above. The sound effects I re-worked into something a little more unique in comparison to the music.


Squeeze!

20mb 3G download limit.

As an example, the uncompressed, 16-bit high-quality wav file of the above 40-second track weighs in at 7.25MB.

Check the wave information in the lower left corner of the window in the following exciting screenshots!

The waveform of the music example above: We are looking at data in white on the bottom left, specifically the file size

forum posts in the hope that the developer would take the hint. As you may have guessed, this approach didn’t work out so well, and neither did outright pleading! These techniques either seemed to involved convoluted processes that the developers didn’t want to spend time on, or involved an endless stream of utilities that didn’t produce the expected results.

When one of my existing iOS games was being ported to the iPad as a ‘HD’ version, I was offered more leeway with the memory, and was able to use IMA 4:1 compressed AIFF files. Using this level of compression on the music example above creates a final file of 1.91MB, without any residual side effects such as raised background noise or noticeable artefacts. While the quality of these files was very nice compared to what I was used to providing (and they looped seamlessly!), it was pretty clear when I sent off the final 15MB folder that I needed to research deeper into compatible compressed file formats.

See white text at bottom left of image

Apple’s developer documentation, I discovered that AAC playback was supported. AAC doesn’t compress as harshly as MP3, but doesn’t add the ‘data’ silence to the beginning of each file.

Due to issues with my audio editor and the AAC codec I used iTunes, of all programs (who knew it could be useful?), right-clicking and using the ‘Create AAC Version’ command I compressed a 7.7MB AIFF File down to a mere 713kb, without sacrificing my lovingly crafted seamless crossfade loop or having to adjust sample rates. AAC quality settings can be adjusted under ‘iTunes Import Settings’.

AAC created from 16bit/48Khz Wavefile

I then tried one last experiment, dropping the sample rates of my pre-AAC files to 22.5KHz, as the extra auditory information in higher samples rates is rather moot when blaring out of such small speakers. The resulting AIFF was a tiny 861KB. I then managed to create a tiny IMA compressed file of 623KB, the very smallest I could crush my original 7.7MB original track.

See text on the bottom left of the image

AAC from IMA compressed 16bit/22KHz AIFF

As you can see, the reduction of sample rate didn’t really save much memory in the grand scheme of things for most Apps, but when the project is borderline 20+ MB, shaving off 100KB could be a lifesaver, more so when applied across multiple music tracks.

concatenated composition, so hopefully this little insight into my audio process will help those fledgling audio designers scratching their heads, as well as giving other team members a glimpse into the process.

@stomp224