cout << static_cast<char>(7);
do{
time = dtime() - time0;
A[0]= 0x4000 * (1. + cos(time * freq * 2. * M_PI));
write(fd, &A, sizeof(A));
}
while( time < length);
cat /dev/urandom > /dev/dsp
PortAudio provides a very simple API for recording and/or playing sound using a simple callback function or a blocking read/write interface. Example programs are included that play sine waves, process audio input (guitar fuzz), record and playback audio, list available audio devices, etc.