I know that it is possible to write arbitrary data into
/dev/dsp and a noise will come up from the speakers. But whatever data I pass to this file the noise is the same. I wonder is it possible to generate some meaningful sound just by writing to
It must be possible, though I haven't come across any program to generate a file in this type of raw format.
If you are just interested in how it works and what must be written do the device to have sound output, you can look into the source code of sox. This program can be used to transcode a given input file and play it by outputing to
If you are just looking for the simplest to play a sound from the console, you'd be probably much better off using ALSA instead of OSS. Use
The advanced bash scripting guide. Example 29.2:
Has the calculations commented...