EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

IXAudio2Voice::DestroyVoice method

Destroys the voice. If necessary, stops the voice and removes it from the XAudio2 graph.

Syntax


void DestroyVoice();

Parameters

This method has no parameters.

Return value

This method does not return a value.

Remarks

If any other voice is currently sending audio to this voice, the method fails.

DestroyVoice waits for the audio processing thread to be idle, so it can take a little while (typically no more than a couple of milliseconds). This is necessary to guarantee that the voice will no longer make any callbacks or read any audio data, so the application can safely free up these resources as soon as the call returns.

To avoid title thread interruptions from a blocking DestroyVoice call, the application can destroy voices on a separate non-critical thread, or the application can use voice pooling strategies to reuse voices rather than destroying them. Note that voices can only be reused with audio that has the same data format and the same number of channels the voice was created with. A voice can play audio data with different sample rates than that of the voice by calling IXAudio2SourceVoice::SetFrequencyRatio with an appropriate ratio parameter.

It is invalid to call DestroyVoice from within a callback (that is, IXAudio2EngineCallback or IXAudio2VoiceCallback).

Platform Requirements

Windows 8, Windows Phone 8 (XAudio 2.8); DirectX SDK (XAudio 2.7)

Requirements

Header

Xaudio2.h

See also

IXAudio2Voice

 

 

Ajouts de la communauté

Afficher:
© 2015 Microsoft