Book Review: Getting Started with C++ Audio Programming for Game Development


Overall this book is exactly as the title suggests, an introduction to audio for game development with C++. It assumes that you are at least familiar with C++ and jumps right into audio. It should be noted that this book uses the FMOD audio engine.

The first chapter serves as an introduction to the core concepts of audio. It’s short, sufficient and has good visuals to explain each topic. We learn of sound waves and their properties volume and pitch. Then we moved on to representing a sound wave as either analog or digital and using sampling rate and bit depth when converting from analog to digital to control the quality. Last we saw that audio systems can have more than one output and various file formats.

For the second and third chapter we get started with FMOD, audio playback and audio control. First we get an overview of FMOD and how to set up the Programmer’s API with a Visual Studio project. Once that is setup we are ready to start! We learn to create and manage the FMOD audio system, how to load sounds both for streaming and into memory and then how to play them. Next we get into checking for errors to make sure everything is running as it should. Finally we’re ready to create our own audio manager class. Now that we can load and play audio files the author goes into how to ways in which we can control the playback. The author then expands on our audio manager class after going over how to control the playback, volume, pitch, panning and channel grouping.

Next in the fourth chapter the author gets into some more advanced features. We start off with 3D audio learning positional audio dealing with different audio soucres coming from specific locations. The author then explains how we simulate how the audio interacts with the environment through a technique called reverberation. Naturally most environments aren’t empty so we get into how to handle obstruction and occlusion from objects. The last couple of pages in this section go over DSP effects(digital signal processing) giving us two quick samples.

In the fifth chapter we get to learn about FMOD Designer and how to use sound events vs. audio files like we have been using. We start off learning to create simple events and how to avoid repetitive sound effects. The author goes over a few examples: a footstep sound loop, breaking glass sound effect and and an ambient track of singing birds. We then move on to multi-track events, these are a significantly more powerful. Expanding on our previous examples we make the footstep loop interactive allowing it to be more versatile. The singing birds turns into a complex forest with different animals that can also change based on the time of day in your simulation.  I thought these were some pretty cool and useful examples that show off how powerful this tool really is.

The fourth and fifth chapters contain code snippets but there is no demo project in the downloadable source code. As this book is a getting started guide and these chapters cover more advanced topics i’m okay with this. Unfortunately there is a shortage of books covering audio for games, but it would be nice to have these topics covered in more detail in a later book.

Finally in the last chapter we dive deep into the low-level audio. Here we work with the bits and bytes of audio data and learn to code much of what FMOD already does for us. We will learn to load a WAV file, play and control the audio data, implement a basic delay effect and synthesize some basic sound waves. Although FMOD already handles everything we recreate in this chapter its a great learning experience to take a look at the underpinnings and see how they work and would be implemented.

All of the source code compiled cleanly and ran as expected. You’ll have to download FMOD Ex and SFML yourself. The author uses Visual Studio 2010. and make sure the project properties are set up (Additional Include Directories, Lib and Post-Build Event to copy the dll’s to your output directory).

This book was pretty short and to the point. It was easy to read, contained good examples and covers exactly what you would expect when reading the title. If you’re looking to add some audio to your game and aren’t already using an engine or framework that already has audio functionality included I would recommend this book as a great starting point. You can check it out here.

I give it: 5/5

Leave a Reply