IAudioClient::Stop method

The Stop method stops the audio stream.

Syntax

HRESULT Stop(

);

Parameters

This method has no parameters.

Return Value

If the method succeeds and stops the stream, it returns S_OK. If the method succeeds and the stream was already stopped, the method returns S_FALSE. If it fails, possible return codes include, but are not limited to, the values shown in the following table.

Return code Description
AUDCLNT_E_NOT_INITIALIZED
The client has not been successfully initialized.
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.

Stop is a control method that stops a running audio stream. This method stops data from streaming through the client's connection with the audio engine. Stopping the stream freezes the stream's audio clock at its current stream position. A subsequent call to IAudioClient::Start causes the stream to resume running from that position. If necessary, the client can call the IAudioClient::Reset method to reset the position while the stream is stopped.

For code examples that call the Stop method, see the following topics:

Requirements

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

See Also

IAudioClient Interface

IAudioClient::Initialize

IAudioClient::Reset

IAudioClient::Start