Tips for Creating Audio for the iPhone

Nathan MadsenJan 10, 2011

Introduction

Because creating audio content specially for the iPhone isn’t too drastically different than creating audio for any other game, this article is a relatively brief collection of tips about how to best adjust audio for the iPhone.

Where’s the bass?!

The iPhone has one external speaker at the bottom end of the device, and a headphone jack at the top left location. The speaker is very small but has decent quality, however you will get very little low end bass from the speaker. The headphones will give you a much better stereo mix. As long as you are aware that your audio can be heard in either of these ways, and plan for it, you can create audio that sounds appropriate and solid in both situations.

File size and type

File types are important on the iPhone, especially MP3s. The iPhone cannot stream multiple MP3 files at once. The most common way to approach the sounds in a game is to have music be a streaming MP3 file (at stereo 128k if the file size is small enough, mono if it needs to be smaller) and use WAV or CAF for the one hit SFX (Sound Effects). SFX are usually down sampled to 22k but that can depend on the game’s graphics and other processing needs. The more simple the game, the more CPU power you have to work with audio and vice versa. When contracting out for a game, always ask the client what the maximum file size is for the streaming music. One of my clients required about 1.5 MB which is equivalent to about a minute and a half or so of music. Another client wanted two and a half minutes of streaming music, so it can vary from project to project.

If possible, attempt to make alternative versions of the same song, and give them to the client. It can be as simple as muting several of the tracks, changing the instrumentation, or performing a different solo. For a client that is open to a larger audio footprint this can really help keep the music within a certain size (per each individual file) but give more variety and make the music less repetitive.

Remove the silent bookends

Anyone that works with MP3 formats should know that it inserts silent bookends that can cause seamless looping to not be so seamless. There are several potential workarounds to this. First, you can compose your music in such a way where having a brief pause feels natural and organic to the music. For this method avoid elements that play continuously at both the start and ending point (like a percussive element or long pad). Instead, have a short break in that constant element which helps cover the MP3’s break, then have the music come back on beat. This can require some testing and nudging to get it to feel metric and steady.

Another way is to find a program that will “trim” the silent sections. You have to find a specialized program for this (however there are many free or cheap ones out there). Do not try to remove the silent gaps in a program like Sound Forge or Logic, and then re-export as another MP3. It will just place them back in the same spots. Do an online search for MP3 trim and you should find plenty of options. I use one that cost $10 and it works great. I usually only focus on the back end of the file, but occasionally it has helped to work on the front end as well.

A final option would be to have the audio engine remove these gaps for you by subtracting the gap’s lengths from the playback region. This is probably the most complicated option so try the first two first before tying up a programmer’s time with this. Remember – it is always best to reduce the amount of dependency you have as much as possible. This keeps you on schedule and lets the rest of the team focus on their other tasks.

A sub point would be to experiment with different looping textures. Test the looping file in a program like Peak Pro or Sound Forge to ensure smooth playback. Avoid testing looping files in programs like Logic or Sonar where you’re using the actual VST or AU plugins in the same session, because this can give a cleaner, false impression than what the actual exported audio content will do. This is because the reverb tails and such are being taken care of within the DAW’s live playback, which does not happen when you’re exporting a region. Also avoid generic programs like Windows Media Player which puts an artificial hiccup in the looped playback and can raise false red flags!

How can I test my content?

Let’s say you’ve just finished an awesome track and you want to test how the mix is going to sound on the iPhone before sending it off to the client. How can you test it? Very easily. Simply load it into a playlist on iTunes then sync your device to it. Voila! Now you can play it on the actual hardware and see how the mix works (or doesn’t work). You can try it with both the speaker and headphones to ensure good sound quality in both. If you don’t want to clutter up your iTunes playlist, you can email the MP3 to yourself and play it right from your email. It is a very simple sequence either way, but it’s surprising how many people do not test their content on the actual device!

Combine things!

On the last few iPhone projects I’ve worked on, Ninjatown: Trees of Doom! being the only one currently released, I’ve started combining the music content with ambient sound effects. This allows the game to stream one file and the player gets the impression of a living world and music background at the same time! Of course there are some downsides to the method – the background ambience cannot be varied since it is embedded with the music track. So that bird will always “tweet” at that same spot on the music. If the client is okay with a larger game size then you could create alternative versions of the music and/or sound design, a Track A and Track B with different effects at different times, and then toggle the playback A – B – A – B and so on. Some clients will want their game as small as possible, so always be sure to check with the client first before starting on this approach.

Always work to video when doing sound design

I’m always surprised how many clients seem to feel giving a playable build of the game is good enough for a sound designer. It isn’t. Always push for a video of the game play. If possible have a video of individual elements, especially when supporting complex in-game events. Sometimes clients may push back, saying they do not have enough time, or want to focus on something else. Just ask them if they want the sound design to be a perfect fit to the game’s action… or just a rough estimate. This will usually win them over. At the very least ask for longer video that shows many aspects of the game play, and “score” to that. In some cases a game’s event may be a randomized length. In other, even more rare cases, a game’s event may be randomized without any indication to the player (for example there’s no power up bar or anything). Always ask about these before starting sound production and take note of them. For fixed length items you can do really cool power ups and power downs that fit the event’s length. For a purely randomized event you need something that can loop seamlessly.

Stick to simple implementation

From all of my experience, the iPhone’s audio engine is not as complex and flexible as some of the current audio engines such as Fmod, Wwise and others. From what I’ve read and learned from teams I’ve worked with, the iPhone can do basic operations such as change songs based on an event, randomize pitch and volume for repeated sound effect calls and do simple fade in and outs. The current phone isn’t going to be able to perform a good deal of live DSP (at least not at the level of the next generation consoles or PC) and it doesn’t use the MIDI-archive system so it cannot change instrumentation or tempo easily. Could an amazing programmer figure out some magical code trickery to achieve, or at least emulate some of this? Quite possibly! But a common game project, which usually has a shorter development cycle and more limited budget than a AAA title simply has bigger fish to fry. When joining a team, feel out their needs and ambitions with regards to audio and the project as a whole. If you happen upon a team that really wants to push the boundaries then, by all means – push the envelope and see what can be done with the iPhone! But don’t be surprised if many of your clients want to create a game with a more simple audio approach.

Final Thoughts

I’ve found creating audio for the iPhone to be a very approachable task. Count your lucky stars because other mobile devices, such as some other cell phones or the Nintendo DS, use a MIDI and archiving system that has many more ins and outs than the iPhone does. I am not able to discuss these items specifically due to Non-Disclosure Agreements, but know that creating a looping MP3 is a much more feasible task! Another plus to iPhone game development is that the teams are usually smaller and much more open to cross discipline work. You can have input on the game’s mechanics, visuals, and plot in addition to creating the audio. In much larger projects you can get “type-cast” into a narrow and often repetitive role. (I know an audio engineer that works only on engine sounds for EA and nothing else.) This is a great, new horizon on the game market so get out there and have fun!



About the Author

Nathan Madsen (madsenstudios.com) is an award winning composer-sound designer who has worked on over 140 projects in the video game, anime and indie film markets. On top of audio work, Nathan has written articles for various game audio books, hosted two video game composition competitions, taught college audio classes and taken part in a lecture series at Austin GDC. Learn more about game audio at gameaudio101.com.