|
|
|
@ -219,12 +219,10 @@ int beep(double freq_hz, double duration_sec)
|
|
|
|
|
int up_count = (int)(SAMPLE_RATE * duration_sec);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
f1 = 0.02;
|
|
|
|
|
f2 = 0.02;
|
|
|
|
|
p1 = p2 = 0.0;
|
|
|
|
|
//for (i = 0; i < 3; i++) {
|
|
|
|
|
//for (j = 0; j < FRAMES*2; j+=2)
|
|
|
|
|
for (j = 0; j < up_count*2; j+=2)
|
|
|
|
|
p1 = p2 = f1 = f2 = 0.0;
|
|
|
|
|
for (i = 0; i < 3; i++) {
|
|
|
|
|
for (j = 0; j < FRAMES*2; j+=2)
|
|
|
|
|
//for (j = 0; j < up_count*2; j+=2)
|
|
|
|
|
{
|
|
|
|
|
buffer[j] = freq_hz*100.0 * sin(p1);
|
|
|
|
|
buffer[j+1] = freq_hz*100.0 * sin(p2);
|
|
|
|
@ -241,7 +239,7 @@ int beep(double freq_hz, double duration_sec)
|
|
|
|
|
}
|
|
|
|
|
if (frames > 0 && frames < FRAMES)
|
|
|
|
|
printf("Short write (expected %li, wrote %li)\n", FRAMES, (long)frames);
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|