Team-FLY |
If you do not have access to an audio device on your machine, you can send ordinary text to a simulated audio device. The simulated audio device consists of a named pipe that replaces the /dev/audio device and a program, slowreader , that reads from the pipe at a fixed rate. In this project replace all references to /dev/audio with your named pipe and run the slowreader program with input redirected to the pipe. The slowreader program is a filter. Eight times a second it reads a 1000-byte block from standard input and writes it to standard output. Use a timer that generates a signal 8 times a second. To see what happens when no data is available, set standard input to nonblocking. Attempt to read 1000 bytes. Output the bytes read. If fewer than 1000 bytes were available, output a message reporting how many bytes were missing. |
Team-FLY |