Skip to content
Snippets Groups Projects
Commit c93238fb authored by deuce's avatar deuce
Browse files

Alternate method for detecting end of playback.

parent 9dd3684e
Branches
Tags
No related merge requests found
......@@ -152,11 +152,9 @@ void SineBeep(double freq, DWORD duration)
goto abrt;
if(waveOutWrite(waveOut, &wh, sizeof(wh))!=MMSYSERR_NOERROR)
goto abrt;
while(!(wh.dwFlags&WHDR_DONE))
SLEEP(1);
abrt:
waveOutUnprepareHeader(waveOut, &wh, sizeof(wh));
waveOutReset(waveOut);
while(waveOutUnprepareHeader(waveOut, &wh, sizeof(wh))==WAVERR_STILLPLAYING)
SLEEP(1);
waveOutClose(waveOut);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment