Skip to content

Latest commit

 

History

History
151 lines (121 loc) · 5.39 KB

nf-audioclient-iaudioclient-seteventhandle.md

File metadata and controls

151 lines (121 loc) · 5.39 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:audioclient.IAudioClient.SetEventHandle
IAudioClient::SetEventHandle (audioclient.h)
The SetEventHandle method sets the event handle that the system signals when an audio buffer is ready to be processed by the client.
IAudioClient interface [Core Audio]
SetEventHandle method
IAudioClient.SetEventHandle
IAudioClient::SetEventHandle
IAudioClientSetEventHandle
SetEventHandle
SetEventHandle method [Core Audio]
SetEventHandle method [Core Audio]
IAudioClient interface
audioclient/IAudioClient::SetEventHandle
coreaudio.iaudioclient_seteventhandle
coreaudio\iaudioclient_seteventhandle.htm
CoreAudio
7bca0c00-5157-43bf-98bd-3bfb23abe860
12/05/2018
IAudioClient interface [Core Audio],SetEventHandle method, IAudioClient.SetEventHandle, IAudioClient::SetEventHandle, IAudioClientSetEventHandle, SetEventHandle, SetEventHandle method [Core Audio], SetEventHandle method [Core Audio],IAudioClient interface, audioclient/IAudioClient::SetEventHandle, coreaudio.iaudioclient_seteventhandle
audioclient.h
Windows
Windows Vista [desktop apps \| UWP apps]
Windows Server 2008 [desktop apps \| UWP apps]
Windows
19H1
IAudioClient::SetEventHandle
audioclient/IAudioClient::SetEventHandle
c++
APIRef
kbSyntax
COM
Audioclient.h
IAudioClient.SetEventHandle

IAudioClient::SetEventHandle

-description

The SetEventHandle method sets the event handle that the system signals when an audio buffer is ready to be processed by the client.

-parameters

-param eventHandle [in]

The event handle.

-returns

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 eventHandle is NULL or an invalid handle.
AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED
The audio stream was not initialized for event-driven buffering.
AUDCLNT_E_NOT_INITIALIZED
The audio stream has not been successfully initialized.
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

This method requires prior initialization of the IAudioClient interface. All calls to this method will fail with the error AUDCLNT_E_NOT_INITIALIZED until the client initializes the audio stream by successfully calling the IAudioClient::Initialize method.

During stream initialization, the client can, as an option, enable event-driven buffering. To do so, the client calls the IAudioClient::Initialize method with the AUDCLNT_STREAMFLAGS_EVENTCALLBACK flag set. After enabling event-driven buffering, and before calling the IAudioClient::Start method to start the stream, the client must call SetEventHandle to register the event handle that the system will signal each time a buffer becomes ready to be processed by the client.

The event handle should be in the nonsignaled state at the time that the client calls the Start method.

If the client has enabled event-driven buffering of a stream, but the client calls the Start method for that stream without first calling SetEventHandle, the Start call will fail and return an error code.

If the client does not enable event-driven buffering of a stream but attempts to set an event handle for the stream by calling SetEventHandle, the call will fail and return an error code.

For a code example that calls the SetEventHandle method, see Exclusive-Mode Streams.

-see-also

IAudioClient Interface

IAudioClient::Initialize

IAudioClient::Start