Home > Engine > Sound Journeys

Sound Journeys

September 23rd, 2009

One of the (one of many) “What went wrong” issues in our project has been late integration of sound into the project. Here is how an issue was triggered which has been keeping us wondering about sound for a few weeks now.

The first sound files we tried to integrate for our characters have been stereo sounds (containing two channels). OpenAL, which is the sound library we are currently using, will not handle 3D sound management for stereo sounds, meaning there will be no attenuation of sound simulated for such audio files. This kept us wondering why no sound fall off is felt when the camera gets away from the characters, after lots of debugging and tweaking every parameter in OpenAL, we lost our trust in the internals of the library and decided to implement our own sound attenuation logic to handle the fall off in the higher game code layers.

Using our own attenuation handling methods meant we did not need to use the build in attenuation techniques of OpenAL and hence we commented out the sound attenuation technique set in the initialization part. This technique was an inverse algorithm, one of the three popular methods for calculating sound attenuation. Doing so enabled the default attenuation for OpenAL which is the linear algorithm.

The next round of sounds we integrated in the game where all mono channel sounds, which is the correct way to make character sounds. The mysteries started at this stage, sound was heard on some machines and nothing was heard on others, leading us to guess about anything and everything that could go wrong from code lines to hardware specs.

What we did not know was that all this time the internal attenuation system of OpenAL was working quite fine and the problem with the initial sound tests had been the stereo sound files. Now the little trick was that the linear attenuation algorithms do not work well, or at all, on the XP operating system but everything is fine on Vista. No sound was heard on XP machines for this reason.

Setting the attenuation technique to inverse again fixed this problem, the problem which made us traverse a full circle just to bring us back to the first step again, oh if we only knew the little trick about stereo files…

Lesson #1: No stereo sound files for dynamic objects

Lesson #2: The linear attenuation algorithm for sound does not work on Windows XP.

Lesson #3: Don’t lose your trust in a proved middleware too early.

Lesson #4: Sound should be integrated early in the project.

VN:F [1.9.3_1094]
Rating: 8.0/10 (27 votes cast)
VN:F [1.9.3_1094]
Rating: +3 (from 5 votes)
Sound Journeys, 8.0 out of 10 based on 27 ratings
Author: fassihi Categories: Engine Tags:
  1. No comments yet.
  1. No trackbacks yet.