Compartilhar via


IChannelAudioVolume::GetAllVolumes

Previous Next

IChannelAudioVolume::GetAllVolumes

The GetAllVolumes method retrieves the volume levels for all the channels in the audio session.

HRESULT GetAllVolumes(
  UINT32  dwCount,
  float  *pfVolumes
);

Parameters

dwCount

[in]  The number of elements in the pfVolumes array. The dwCount parameter must equal the number of channels in the stream format for the audio session. To get the number of channels, call the IChannelAudioVolume::GetChannelCount method.

pfVolumes

[out]  Pointer to an array of volume levels for the channels in the audio session. This parameter points to a caller-allocated float array into which the method writes the volume levels for the individual channels. Volume levels are in the range 0.0 to 1.0.

Return Value

If the method succeeds, it returns S_OK. If it fails, possible return codes include, but are not limited to, the values shown in the following table.

Return code Description
E_INVALIDARG Parameter dwCount does not equal the number of channels in the stream format for the audio session.
E_POINTER Parameter pfVolumes is NULL.
AUDCLNT_E_DEVICE_INVALIDATED The audio endpoint device has been unplugged, or the audio hardware or associated hardware resources have been reconfigured, disabled, removed, or otherwise made unavailable for use.
AUDCLNT_E_SERVICE_NOT_RUNNING The Windows audio service is not running.

Remarks

Clients can call the IChannelAudioVolume::SetAllVolumes or IChannelAudioVolume::SetChannelVolume method to set the per-channel volume levels in an audio session.

Requirements

Client: Windows Vista

Header: Include Audioclient.h.

See Also

Previous Next