AUDCLNT_STREAMFLAGS_XXX Constants

Specifies characteristics that a client can assign to an audio stream during the initialization of the stream.

Constant/valueDescription
AUDCLNT_STREAMFLAGS_CROSSPROCESS
0x00010000

The audio stream will be a member of a cross-process audio session. For more information, see Remarks.

AUDCLNT_STREAMFLAGS_LOOPBACK
0x00020000

The audio stream will operate in loopback mode. For more information, see Remarks.

AUDCLNT_STREAMFLAGS_EVENTCALLBACK
0x00040000

Processing of the audio buffer by the client will be event driven. For more information, see Remarks.

AUDCLNT_STREAMFLAGS_NOPERSIST
0x00080000

The volume and mute settings for an audio session will not persist across system restarts. For more information, see Remarks.

AUDCLNT_STREAMFLAGS_RATEADJUST
0x00100000

This constant is new in Windows 7. The sample rate of the stream is adjusted to a rate specified by an application. For more information, see Remarks.

Remarks

The IAudioClient::Initialize method and the DIRECTX_AUDIO_ACTIVATION_PARAMS structure use the AUDCLNT_STREAMFLAGS_XXX constants.

The AUDCLNT_STREAMFLAGS_CROSSPROCESS flag indicates that the audio session for the stream is a cross-process session. A cross-process session can accept streams from more than one process. If two applications in two separate processes call IAudioClient::Initialize with identical session GUIDs, and both applications set the AUDCLNT_SHAREMODE_CROSSPROCESS flag, then the audio engine assigns their streams to the same cross-process session. This flag overrides the default behavior, which is to assign the stream to a process-specific session rather than a cross-process session. The AUDCLNT_STREAMFLAGS_CROSSPROCESS flag bit is incompatible with exclusive mode. For more information about cross-process sessions, see Audio Sessions.

The AUDCLNT_STREAMFLAGS_LOOPBACK flag enables loopback recording. In loopback recording, the audio engine copies the audio stream that is being played by a rendering endpoint device into an audio endpoint buffer so that a WASAPI client can capture the stream. If this flag is set, the IAudioClient::Initialize method attempts to open a capture buffer on the rendering device. This flag is valid only for a rendering device and only if the Initialize call sets the ShareMode parameter to AUDCLNT_SHAREMODE_SHARED. Otherwise the Initialize call will fail. If the call succeeds, the client can call the IAudioClient::GetService method to obtain an IAudioCaptureClient interface on the rendering device. For more information, see Loopback Recording.

The AUDCLNT_STREAMFLAGS_EVENTCALLBACK flag enables event-driven buffering. If a client sets this flag in the call to IAudioClient::Initialize that initializes a stream, the client must subsequently call the IAudioClient::SetEventHandle method to supply an event handle for the stream. After the stream starts, the audio engine will signal the event handle to notify the client each time a buffer becomes ready for the client to process. WASAPI supports event-driven buffering for both rendering and capture buffers. Both shared-mode and exclusive-mode streams can use event-driven buffering. For a code example that uses the AUDCLNT_STREAMFLAGS_EVENTCALLBACK flag, see Exclusive-Mode Streams.

The AUDCLNT_STREAMFLAGS_NOPERSIST flag disables persistence of the volume and mute settings for a session that contains rendering streams. By default, the volume level and muting state for a rendering session are persistent across system restarts. The volume level and muting state for a capture session are never persistent. For more information about the persistence of session volume and mute settings, see Audio Sessions.

The AUDCLNT_STREAMFLAGS_RATEADJUST flag enables an application to get a reference to the IAudioClockAdjustment interface that is used to set the sample rate for the stream. To get a pointer to this interace, an application must initialize the audio client with this flag and then call IAudioClient::GetService by specifying the IID_IAudioClockAdjustment identifier. To set the new sample rate, call IAudioClockAdjustment::SetSampleRate. This flag is valid only for a rendering device. Otherwise the GetService call fails with the error code AUDCLNT_E_WRONG_ENDPOINT_TYPE. The application must also set the ShareMode parameter to AUDCLNT_SHAREMODE_SHARED during the Initialize call. SetSampleRate fails if the audio client is not in shared mode.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Audiosessiontypes.h

See also

Core Audio Constants
IAudioCaptureClient Interface
IAudioClient::GetService
IAudioClient::Initialize
IAudioClient::SetEventHandle

 

 

Community Additions

ADD
Show:
© 2015 Microsoft