Mixing and Surround Sound
By Robert Basler
Gamasutra
December 18, 1998
Vol. 2: Issue 4
9


MIXING & SURROUND SOUND
Introduction

Digital Audio Mixing

Dolby Pro-Logic Encoding

Latency Versus Underflow

Things I Learned

Cross platform audio support is a problem for many game developers. There are lots of good audio libraries out there, but if they don't support a platform a developer wants, he/she is stuck.

I found myself in this unenviable position in my current gaming project. Since I had always had an interest in audio, I figured I would put together an audio mixing library of my own. After all, how hard could it be? If you want to find out how digital audio mixing works, it can be a little challenging since there don't seem to be a lot of good resources on the subject.

A trip to my local university library turned up a stack of books on digital audio theory, but not one of them bothered to explain how to mix two digital audio streams. Fortunately for me, a few long trips to the World Wide Web provided me with the answers I needed.

The audio mixing engine I'm working on is based around the idea of tracks. Tracks are played for the user and positioned relative to the user, using three-dimensional coordinates taken from the graphics-render-ing engine. You can have up to 32 tracks playing at any given time and they are mixed without hardware assistance. Each track is a single WAV file; it can be either mono or stereo, 8-bit or 16-bit. Output is either through standard stereo speakers, or through a Dolby Pro-Logic amplifier for really big sound.

Digital Audio Mixing  Next Page