To record audio, for example, from a Firefox/Flash-based application, running on Fedora 11, the following command seems to work:
pacat --record | sox -t raw -r 44100 -s -L -b 16 -c 2 - "output.wav"
Installation and usage instructions after the break…
The “pacat” command is the pulseaudio command-line audio recording/playback utility. In this instance, it is being used to “–record” from the default source (this can be changed, if needed, using additional command-line parameters).
The “pacat” command defaults to exporting “raw” formatted data, which must then be converted to a valid wave file using the “sox” utility.
The “sox” utility is part of the “Sound eXchange” utility for linux, which is a “swiss-army-knife” multi-use application. In this case, it is being used to convert the raw output from pacat to the more traditional 44K,16bit, Stereo WAV file that is ubiquitous in PC computing.
This can be further converted to an MP3, but how to do so is beyond the scope of this document at this time.
To install the pacat utility (part of pulseaudio-utils):
#yum install pulseaudio-utils
To install the sox utility:
#yum install sox