AUDCLNT_STREAMFLAGS_XXX Constants

Previous Next

AUDCLNT_STREAMFLAGS_XXX Constants

The AUDCLNT_STREAMFLAGS_XXX constants indicate special characteristics that a client can assign to an audio stream during the initialization of the stream.

#define AUDCLNT_STREAMFLAGS_CROSSPROCESS   0x00010000
#define AUDCLNT_STREAMFLAGS_LOOPBACK       0x00020000
#define AUDCLNT_STREAMFLAGS_EVENTCALLBACK  0x00040000
#define AUDCLNT_STREAMFLAGS_NOPERSIST      0x00080000

Constants

AUDCLNT_STREAMFLAGS_CROSSPROCESS

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

AUDCLNT_STREAMFLAGS_LOOPBACK

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

AUDCLNT_STREAMFLAGS_EVENTCALLBACK

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

AUDCLNT_STREAMFLAGS_NOPERSIST

The volume and mute settings for an audio session will not persist across system restarts. 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.

Requirements

Client: Windows Vista

Header: Include Audiosessiontypes.h

See Also

Previous Next