Partager via


IAudioStreamVolume Interface

Previous Next

IAudioStreamVolume Interface

The IAudioStreamVolume interface enables a client to control and monitor the volume levels for all of the channels in an audio stream. The client obtains a reference to the IAudioStreamVolume interface on a stream object by calling the IAudioClient::GetService method with parameter riid set to REFIID IID_IAudioStreamVolume.

The effective volume level of any channel in the session submix, as heard at the speakers, is the product of the following four volume-level factors:

  • The per-channel volume levels of the streams in the session, which clients can control through the methods in the IAudioStreamVolume interface.
  • The per-channel volume level of the session, which clients can control through the methods in the IChannelAudioVolume interface.
  • The master volume level of the session, which clients can control through the methods in the ISimpleAudioVolume interface.
  • The policy-based volume level of the session, which the system dynamically assigns to the session as the global mix changes.

Each of the four volume-level factors in the preceding list is a value in the range 0.0 to 1.0, where 0.0 indicates silence and 1.0 indicates full volume (no attenuation). The effective volume level is also a value in the range 0.0 to 1.0.

When releasing an IAudioStreamVolume interface instance, the client must call the interface's Release method from the same thread as the call to IAudioClient::GetService that created the object.

The IAudioStreamVolume interface controls the channel volumes in a shared-mode audio stream. This interface does not work with exclusive-mode streams. For information about volume controls for exclusive-mode streams, see EndpointVolume API.

IAudioStreamVolume inherits from the IUnknown interface. In addition to the methods inherited from IUnknown, IAudioStreamVolume supports the following methods.

Method Description
GetAllVolumes Retrieves the volume levels for all the channels in the audio stream.
GetChannelCount Retrieves the number of channels contained in the audio stream.
GetChannelVolume Retrieves the volume level for the specified channel in the audio stream.
SetAllVolumes Sets the individual volume levels for all the channels in the audio stream.
SetChannelVolume Sets the volume level for the specified channel in the audio stream.

Requirements

Client: Windows Vista

Header: Include Audioclient.h.

See Also

Previous Next