IAudioClient::Stop Method

The Stop method stops the audio stream.

Syntax

public:
HRESULT Stop(
         void
)  

Parameters

Type: void 

This method does not take any parameters.

Return value

Type: HRESULT 

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 codes
Return code Description
AUDCLNT_E_NOT_INITIALIZED The client has not been successfully initialized.
AUDCLNT_E_SERVICE_NOT_RUNNING The audio service is not running.

Refer to WASAPI error codes.

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

Header: Declared in audioclient.h.

Library: Use mmdevapi.lib.

See also

IAudioClient

IAudioClient Members