Mr. Poogle has come out of retirement to help show us how the new WTAudioClip3D works in Web Driver 2.2.
In the scene above, there is a 3D audio clip in the center of the grid. Use the arrow keys to move Mr. Poogle forward and backwards and turn him left and right. Listen to how Mr. Poogle hears the sound differently based on his position and rotation. You can also see the volume level for each ear in the two bar graphs.
In this lab, you have control over the size of the world. Changing the world size simply scales the entire world so that the outside of the orange circle represents the number of units you type into the box. You also have control over the minimum and maximum distances for the audio clip as set with the API. These distances define how the volume fades out over distance. If you are within the minimum distance, the volume is always 100%. Beyond that point, the volume then fades out until it gets to zero or the maximum distance, whichever comes first. This fade-out depends on the minimum distance and is logarithmic, just like the decibel scale we use in reality. You can't hear the sound outside the maximum distance.
Of course, the Web Driver also accounts for the pan, which is the volume level per ear as a function of which way your head is turned. If you are brave, you can look into the source code to see the equations.
The WTAudioClip3D object exists in your Web Driver scene and can be positioned just like any other object.
The Web Driver uses the last camera rendered as the "listener" for the audio clip. This is fine if your scene only has one camera, but you may hear some weird effects if you have two or more. Therefore, it is recommended to use the setCamera() method to select a camera to be the "listener" for the audio clip. Having a camera added to Mr. Poogle and used as the listener allows us to pull off the trick of looking through one camera and "hearing through" another.
WT::createAudioClip3D, WTAudioClip3D::setCamera, WTAudioClip3D::setMinDistance, WTAudioClip3D::setMaxDistance