Export (0) Print
Expand All

ISpAudio::GetVolumeLevel (SAPI 5.3)

Speech API 5.3
Microsoft Speech API 5.3


ISpAudio::GetVolumeLevel passes back the current volume level.

The volume level is on a linear scale from zero to 10000.

HRESULT GetVolumeLevel(
   ULONG   *pLevel


[out] Pointer to the returned volume level.

Return values

S_OKFunction completed successfully.
SPERR_UNINITIALIZEDAudio interface is not initialized.
SPERR_DEVICE_NOT_SUPPORTED The device is not valid or does not support volumes.
E_POINTERpLevel is invalid or bad.
FAILED(hr)Appropriate error message.


For input devices with a boost control for the microphone, SAPI will split the volume range into two to allow automated use of the boost. The boost will be off from zero to 4999 and on from 5000 to 10,000. In each range, the full volume range of the device will be used independently. This can lead to discontinuity in the input energy level for a constant volume sound source. On some sound cards, the boost is applied to the input volume, but on others, the boost is applied to the playback volume resulting in the two ranges behaving identically because the input level is unaffected.

Microphone wizards determining the best volume input level should take into consideration the potential discontinuity and ensure that the algorithm used to adjust the input volume level can handle the various possible forms of discontinuity at 5,000

For devices without a boost, there is no discontinuity at 5000.

© 2014 Microsoft