IDirectSoundBuffer::GetVolume

HRESULT GetVolume(LPLONG lplVolume);

Retrieves the current volume for this sound buffer.

·Returns DS_OK if successful, or one of the following error values otherwise:

DSERR_CONTROLUNAVAIL DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED  

lplVolume

Address of the variable to contain the volume associated with the specified DirectSound buffer.

The volume is specified in hundredths of decibels (dB), and ranges from 0 to -10,000. The value 0 represents the original, unadjusted volume of the stream. The value -10,000 indicates an audio volume attenuated by 100 dB, which, for all practical purposes, is silence. Amplification is not currently supported by DirectSound.

The decibel (dB) scale corresponds to the logarithmic hearing characteristics of the ear. For example, an attenuation of 10 dB makes a buffer sound half as loud, and an attenuation of 20 dB makes a buffer sound one quarter as loud.