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

Undo last change... DO NOT DO DSP WHILE TIRED! :-)

parent 9f6596d4
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,7 @@ void makesine(double freq, unsigned char *wave, int samples) ...@@ -60,7 +60,7 @@ void makesine(double freq, unsigned char *wave, int samples)
wave[i]=127; wave[i]=127;
} }
/* Fade out */ /* Fade out */
for(k=2;k<=10;k++) { for(k=10;k>1;k--) {
for(;i>0;i--) { for(;i>0;i--) {
if(!endhigh && wave[i]<=127) if(!endhigh && wave[i]<=127)
break; break;
...@@ -96,7 +96,7 @@ void makesine(double freq, unsigned char *wave, int samples) ...@@ -96,7 +96,7 @@ void makesine(double freq, unsigned char *wave, int samples)
wave[i]=127; wave[i]=127;
} }
/* Fade in */ /* Fade in */
for(k=2;k<=10;k++) { for(k=10;k>1;k--) {
for(;i<samples;i--) { for(;i<samples;i--) {
if(!starthigh && wave[i]<=127) if(!starthigh && wave[i]<=127)
break; break;
...@@ -152,7 +152,8 @@ void SineBeep(double freq, DWORD duration) ...@@ -152,7 +152,8 @@ void SineBeep(double freq, DWORD duration)
goto abrt; goto abrt;
if(waveOutWrite(waveOut, &wh, sizeof(wh))!=MMSYSERR_NOERROR) if(waveOutWrite(waveOut, &wh, sizeof(wh))!=MMSYSERR_NOERROR)
goto abrt; goto abrt;
SLEEP(duration); while(!(wh.dwFlags&WHDR_DONE))
SLEEP(1);
abrt: abrt:
waveOutUnprepareHeader(waveOut, &wh, sizeof(wh)); waveOutUnprepareHeader(waveOut, &wh, sizeof(wh));
waveOutReset(waveOut); waveOutReset(waveOut);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment