Friday, December 19, 2008

Stupid nix trix: Making awful noises, or testing your speakers in linux

Because everything in linux / Unix / MacOS X is a file, you can do some interesting things with devices, like send data straight to them. Your sound card is typicaly denoted by /dev/dsp. There is another file that is a (pseudo)random number generator and it is /dev/random or /dev/urandom. There is also a program that has a primary purpose of the low-level copying and conversion of raw data. So you can pipe garbage to your soundcard with this:

dd if=/dev/urandom of=/dev/dsp
or
sudo dd if=/dev/urandom of=/dev/dsp

This will work in cygwin as well.

No comments: