CS191 - Assignment 4 - 3D Sound


For this assignment, we had to create a virtual (3D) sonic environment with at least one source and one listener using either DirectSound or OpenAL. I used DirectSound, and the executable can be downloaded below.

Download now!

There is one listener, and there are three sound sources. The listener is essentially your ship (the location moves as your ship moves). One sound source is your weapon; whenever you fire (space), a laser sound is played wherever your ship is located. The second sound source is the target (sphere). The target moves in a circle in the environment while playing a clicking sound repeatedly. You can hear the sound move around the environment as you move your ship with the arrow keys. The third sound source is located behind the hole in the wall at the top of the screen. It is emitting a sound within a sound cone that is directed in the negative Y direction, so it is only audible within a certain area near the hole.

Note: I have had some problems getting this to work correctly under certain hardware/OS configurations. The sound cone for the third sound source mentioned above works, but the maximum distance does not appear to work in conjunction with the sound cone. The sound should be muted if the ship (listener) is in about the bottom half of the screen, but the sound continues to play. If you know anything about this problem, please email me.

Screen shot: