How to localize sounds in 3D with VSS.

Camille Goudeseune
You can make a sound come from a particular (x,y,z) position, if you use more than one loudspeaker. (You can't really make a sound appear to come from a point closer to you than the closest speaker, though; for that you need headphones. In the CAVE, then, you can make sounds appear to come from beyond the walls, not inside the walls. VSS tries its best to get around the laws of physics, nevertheless. Try it and see.)

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.


Checklist for setting up 8-channel sound in the NCSA Cave:
  1. Move two of the floor speakers to the front. (The ones with extension cords are the only ones that will move.)
  2. Plug the blue audio cables into the front floor speakers. The jack is at the back of the speaker -- you can see it if you turn the speaker upside down.
  3. Turn on all 4 speakers. The switch is at lower left, and a green power LED will turn on.
  4. On cassatt, run "apanel".
    From the "Default" menu, choose "Output", then "ADAT Out".
    Then from the "Selected" menu, choose "Sample Rate", then "44.1 kHz".
  5. Run VSS at a sampling rate of 44.1 kHz and 8 channels.

  6. Be nice and put the front floor speakers back when you're done.
[ back ] [ up to main page ]