Stopping, Pausing, and Restarting Playback
You can stop or pause playback while waveform audio is playing. After playback has been paused, you can restart it. Windows provides the following functions for controlling waveform-audio playback.
Function | Description |
waveOutPause | Pauses playback on a waveform-audio output device. |
waveOutReset | Stops playback on a waveform-audio output device and marks all pending data blocks as done. |
waveOutRestart | Resumes playback on a paused waveform-audio output device. |
Pausing a waveform-audio device by using waveOutPause might not be instantaneous; the driver may finish playing the current block before pausing playback.
Generally, as soon as the first waveform-audio data block is sent by using the waveOutWrite function, the waveform-audio device begins playing. If you do not want the sound to start playing immediately, call waveOutPause before calling waveOutWrite. Then, when you want to begin playing waveform-audio data, call waveOutRestart.
You cannot use waveOutRestart to restart a device that has been stopped with waveOutReset; you must use waveOutWrite to send the first data block to resume playback on the device.