Gets the current overall volume level of the voice.
public:
void GetVolume(
float *pVolume
)
pVolume
Type: float *
[out] Returns the current overall volume level of the voice. See Remarks for more information on volume levels.
Volume levels are expressed as floating-point amplitude multipliers between -224 to 224, with a maximum gain of 144.5 dB. A volume level of 1 means there is no attenuation or gain and 0 means silence. Negative levels can be used to invert the audio’s phase. See XAudio2 Volume and Pitch Control for additional information on volume control.
Note
GetVolume always returns the volume most recently set by IXAudio2Voice::SetVolume. However, it may not actually be in effect yet: it only takes effect the next time the audio engine runs after the IXAudio2Voice::SetVolume call (or after the corresponding IXAudio2::CommitChanges call, if IXAudio2Voice::SetVolume was called with a deferred operation ID).
Header: Declared in xaudio2.h.
Library: Use xaudio2.lib.