Skip to content

Latest commit

 

History

History
114 lines (80 loc) · 4.3 KB

nf-xaudio2-ixaudio2sourcevoice-stop.md

File metadata and controls

114 lines (80 loc) · 4.3 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:xaudio2.IXAudio2SourceVoice.Stop
IXAudio2SourceVoice::Stop (xaudio2.h)
Stops consumption of audio by the current voice.
IXAudio2SourceVoice interface [XAudio2 Audio Mixing APIs]
Stop method
IXAudio2SourceVoice.Stop
IXAudio2SourceVoice::Stop
Stop
Stop method [XAudio2 Audio Mixing APIs]
Stop method [XAudio2 Audio Mixing APIs]
IXAudio2SourceVoice interface
xaudio2.ixaudio2sourcevoice_interface_stop
xaudio2/IXAudio2SourceVoice::Stop
xaudio2\ixaudio2sourcevoice_interface_stop.htm
xaudio2
M:Microsoft.directx_sdk.ixaudio2sourcevoice.IXAudio2SourceVoice.Stop(UINT32,UINT32)
12/05/2018
IXAudio2SourceVoice interface [XAudio2 Audio Mixing APIs],Stop method, IXAudio2SourceVoice.Stop, IXAudio2SourceVoice::Stop, Stop, Stop method [XAudio2 Audio Mixing APIs], Stop method [XAudio2 Audio Mixing APIs],IXAudio2SourceVoice interface, xaudio2.ixaudio2sourcevoice_interface_stop, xaudio2/IXAudio2SourceVoice::Stop
xaudio2.h
Windows
Windows
19H1
IXAudio2SourceVoice::Stop
xaudio2/IXAudio2SourceVoice::Stop
c++
APIRef
kbSyntax
COM
xaudio2.h
IXAudio2SourceVoice.Stop

IXAudio2SourceVoice::Stop

-description

Stops consumption of audio by the current voice.

-parameters

-param X2DEFAULT

TBD

-param Flags [in]

Flags that control how the voice is stopped. Can be 0 or the following:

Value Description
XAUDIO2_PLAY_TAILS Continue emitting effect output after the voice is stopped. 

-param OperationSet [in]

Identifies this call as part of a deferred batch. See the XAudio2 Operation Sets overview for more information.

-returns

Returns S_OK if successful, an error code otherwise. See XAudio2 Error Codes for descriptions of XAudio2 specific error codes.

-remarks

All source buffers that are queued on the voice and the current cursor position are preserved. This allows the voice to continue from where it left off, when it is restarted. The IXAudio2SourceVoice::FlushSourceBuffers method can be used to flush queued source buffers.

By default, any pending output from voice effects—for example, reverb tails—is not played. Instead, the voice is immediately rendered silent. The XAUDIO2_PLAY_TAILS flag can be used to continue emitting effect output after the voice stops running.

A voice stopped with the XAUDIO2_PLAY_TAILS flag stops consuming source buffers, but continues to process its effects and send audio to its destination voices. A voice in this state can later be stopped completely by calling Stop again with the Flags argument set to 0. This enables stopping a voice with XAUDIO2_PLAY_TAILS, waiting sufficient time for any audio being produced by its effects to finish, and then fully stopping the voice by calling Stop again without XAUDIO2_PLAY_TAILS. This technique allows voices with effects to be stopped gracefully while ensuring idle voices will not continue to be processed after they have finished producing audio.

Stop is always asynchronous, even if called within a callback.

Note  XAudio2 never calls any voice callbacks for a voice if the voice is stopped (even if it was stopped with XAUDIO2_PLAY_TAILS).
 

Platform Requirements

Windows 10 (XAudio2.9); Windows 8, Windows Phone 8 (XAudio 2.8); DirectX SDK (XAudio 2.7)

-see-also

IXAudio2SourceVoice

XAPO Overview