By Robert
Basler
Gamasutra
December 18, 1998
Vol. 2: Issue 49
|
The first thing I discovered when I started
using the audio mixer was that it couldn't cope with looping tracks. Tracks
always had to start on a buffer boundary. Fortunately this was easy to
work around by modifying the mixing setup routine to call the assembly
-optimized mixing routines more than once per output buffer, if needed.
Another problem that quickly came to light was that the 3D position of
the audio tracks was only updated once per buffer. That afforded a little
more than 1 position update a second at 11KHz mono, 8-bit output using
the 8K buffer size suggested by the sound card driver. I toyed with the
idea of using direction vectors and interpolation to continuously update
the position of objects during mixing, but this would have hopelessly
complicated the assembly routines and have made them so slow I would have
to wait for Alphas to hit the mainstream gaming market. Instead I decided
to make the internal buffer size a fraction of the external buffer size
so that each track's position would be updated about ten times a second
regardless of the output format.
So far I haven't had performance problems mixing in software, but some
sort of priority system that comes into play on slower systems in order
for low volume and low priority tracks to be skipped, is probably going
to be added before too long. Also, if the user is not using a Dolby Pro-Logic
decoder, he/she should have an option to turn off surround mixing.
In the End
I'd like to thank David Welch and Ethan Brodsky for providing some of
the information this article is based on. This mixing engine is still
very much a work in progress. The Dolby Pro-Logic effects work great,
but for people with just a pair of headphones, I'd love to add positional
audio. Now I just have to find an algorithm that will run in real time
on conventional hardware. Back to the Internet...
Robert Basler is President and CEO of Aurora Systems,
Inc., a leading edge developer of software products for people with speech,
language, learning, and physical disabilities. He develops games in hopes
of striking it rich one day. He can be reached at aurorasw@direct.ca
or you can check out his website http://www.djtech.com/Aurora/
|