Recently a linuxer pointed out that in spite of the amazing and widespread capabilities of FFmpeg, I have just been focused upon its media conversion feature. If you take a look at all our previous ffmpeg articles, the guy is right. So, from now we will discuss other features of the superstar too, starting with audio recording.
Why don't you try out the command first and we will see later how it actually works.
[shredder12]$ ffmpeg -f oss -i /dev/dsp audio.mp3
Once you run this command you will see ffmpeg saving some data in the file audio.mp3. What is it? Its actually recording all the audio that is going through the device /dev/dsp. Try speaking something on your microphone and play the file.
We can even do some pretty cool stuff using the device /dev/dsp.
But first, what is this device /dev/dsp? It is an audio sampling and recording device, stands for Digital Signal processor. It converts audio signal(from microphone) to digital(for computer) and vice versa. This device only understands complete raw audio, playing an encoded file (mp3, ogg etc.) will just result in garbage sound. And by raw audio file I meant a meaningful music, you can literally give any file to this device as input and it will play it. All it care for are bits and bytes which is what every file is made of. Try playing any of your hard disk partition for fun sake
.
[shredder12]$ cat /dev/sda1 > /dev/dsp
After doing that, you can say and actually mean "Windows doesn't sound good"
.