XAudio2: Stop Currently Playing Sound

July 02, 2011 SlimDX, XAudio2

Using SlimDX, if you want to stop a sound which is currently playing via XAudio2, use the following methods on the SourceVoice object:

sourceVoice.Stop(); sourceVoice.FlushSourceBuffers();