int Beep (int time, int volume, int pitch)
{
- static int last_pitch = -1, last_n = -1, last_volume = -1;
- int i, n, first_len, down_len, cycle;
- double dt;
-
+ int n;
/*
* Finagle the number of samples
*/
if (volume <= 0) {
snd_pcm_writei(handle, silence, channels*n);
} else {
+ static int last_pitch = -1, last_n = -1, last_volume = -1;
+ int first_len, down_len, cycle;
/*
* clip to Nyquist
* (Of course this means that if you ask for too high a frequency you
last_pitch = pitch;
last_n = n;
last_volume = volume;
+ double dt;
+ int i;
dt = 2. * M_PI / cycle; /* sine scale factor */
int Beep (int time, int volume, int pitch)
{
- static int last_pitch = -1, last_n = -1, last_volume = -1;
- int i, n, first_len, down_len, cycle;
- double dt;
-
+ int n;
/*
* Finagle the number of samples
*/
}
else
{
+ static int last_pitch = -1, last_n = -1, last_volume = -1;
+ int first_len, down_len, cycle;
/*
* clip to Nyquist
* (Of course this means that if you ask for too high a frequency you
last_pitch = pitch;
last_n = n;
last_volume = volume;
-
+ int i;
+ double dt;
+
dt = 2. * M_PI / cycle; /* sine scale factor */
/* Ramp up; begin with silence */