Microsoft DirectX 8.1 (Visual Basic)

Rolloff Factor

Rolloff is the amount of attenuation that is applied to sounds, based on the listener's distance from the sound source. DirectSound can ignore rolloff, exaggerate it, or give it the same effect as in the real world, depending on a variable called the rolloff factor.

The rolloff factor can range from DS3D_MINROLLOFFFACTOR to DS3D_MAXROLLOFFFACTOR, defined as 0.0 and 10.0 respectively. A value of DS3D_MINROLLOFFFACTOR means no rolloff is applied to a sound. Every other value represents a multiple of the real-world rolloff. In other words, a value of 1 (DS3D_DEFAULTROLLOFFFACTOR) means the rolloff that would be experienced in the real world is applied to the sound, a value of 2 means twice the real-world rolloff, and so on.

Set and retrieve the rolloff factor for all sounds by using the DirectSound3DListener8.SetRolloffFactor and DirectSound3DListener8.GetRolloffFactor methods.

To change the effect of distance for an individual sound buffer, you can set the minimum distance for the buffer. For more information, see Minimum and Maximum Distances.