IAudioStreamVolume::GetChannelCount method (audioclient.h)

The GetChannelCount method retrieves the number of channels in the audio stream.


HRESULT GetChannelCount(
  [out] UINT32 *pdwCount


[out] pdwCount

Pointer to a UINT32 variable into which the method writes the channel count.

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
Parameter pdwCount is NULL.
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.
The Windows audio service is not running.


Call this method to get the number of channels in the audio stream before calling any of the other methods in the IAudioStreamVolume interface.


Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header audioclient.h

See also

IAudioStreamVolume Interface