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

If a frequency of less than 17 (The lowest audible frequency for elephants...

Humans generally gan't hear anything below 20Hz) force to 17.  Fixes a one-
in-800 chance of segfault from sbbs_t::inkey() when it beeps.
parent a54b3cf3
Branches
Tags
No related merge requests found
......@@ -195,6 +195,8 @@ BOOL DLLCALL xptone(double freq, DWORD duration, enum WAVE_SHAPE shape)
int i;
unsigned char wave[S_RATE*15/2+1];
if(freq<17)
freq=17;
samples=S_RATE*duration/1000;
if(samples<=S_RATE/freq*2)
samples=S_RATE/freq*2;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment