DirectX SDK

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, currently defined in Dsound.h 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.

[C++]

You set and retrieve the rolloff factor by using the IDirectSound3DListener::SetRolloffFactor and IDirectSound3DListener::GetRolloffFactor methods.

[Visual Basic]

You set and retrieve the rolloff factor by using the DirectSound3DListener.SetRolloffFactor and DirectSound3DListener.GetRolloffFactor methods.

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