Looping Playback
A version of this page is also available for
4/8/2010
You can loop the playback of a single audio buffer. To control how the playback loops, use the WAVEHDR structure passed to waveOutWrite.
To loop playback
Set the WHDR_BEGINLOOP and the WHDR_ENDLOOP flags in the dwFlags member of the WAVEHDR structure.
Set the number of loops in the dwLoops member of the same WAVEHDR structure.
Pass the WAVEHDR structure to waveOutWrite.
This action causes your device to begin looping.
Use the waveOutBreakLoop function to break out of the loop prematurely.