Steady tones are the worst things to localize. The ever-present sirens in Champaign-Urbana attest to this -- you can never tell where that fire truck is. The electric carts trundling through the concourses of O'Hare airport have a much better "chirp" sound which you can immediately place. This is because easily localized sounds (a) are high, (b) contain many frequencies, (c) vary quickly, particularly at the beginning. (Most bird songs are like this, too. They ought to know.)
Try out this example:
audpanel triggered_aiff_xyz.ap triggered_aiff_xyz.aud
(Copy these two files, along with chirp.aiff, to
your own directory. Change the SetDirectory command in
triggered_xyz.aud to point to this directory.
Also, you can find the program audpanel in the directory where
VSS is installed.)
Try it with VSS running at different numbers of channels (1, 2, 4, 8),
but not more than the number of speakers you have, of course.
Click on "Sending" and then adjust the sliders, to move the sound around.
To play this chirp soundfile from your own C code, add the command
AUDupdateSimple("Audpanel", 3, array_of_three_floats);
where the array contains the x, y, and z-coordinates (in the standard
CAVE coordinate system, in feet) of the sound's position.
You can change the string "Audpanel" in your C code and
in your .aud file to something more meaningful. You can also, of course,
change "chirp.aiff" in triggered_aiff_xyz.aud to something else.
The heart of this localization technique is the
SetXYZ
command.
SetXYZ will "do the right thing" with fewer speakers, too,
so you can still hear what's going on with two speakers (or even one -
sounds which are farther away get quieter and duller).
Another example, using computed sound instead of playing .aiff files:
audpanel
triggered_xyz.ap
triggered_xyz.aud
A third example, a complete OpenGL Cave application with balls bouncing around in a box.