Table of Contents

Ubuntu - Sound - Recording audio from the command line

Set up the recording channels by doing

alsamixer

Once there, select the capture view by typing the tab key.

With the arrow keys select the column Capture and set it to the CAPTURE mode with the space key.

Adjust the recording volume with the arrow keys.

You can also set it up with the gnome volume control panel going to the capture tab.


Recording sound to an mp3 file

You’ll need the lame mp3 encoder. Install it by doing

sudo apt-get install lame

Type the following command

arecord -f cd -t raw | lame -x -r - out.mp3

Arecord captures the audio that goes through your computer and pipes it to the lame encoder, so you encode the audio directly to an mp3 file. You can specify more options to the lame encoder such as the bitrate with lame -x -b bitrate. Without specifying the bitrate it encodes to 128kbps constant bit rate cbr. If you want to record for an specific amount of time then:

arecord -f cd -d numberofseconds -t raw | lame -x -r - out.mp3

This works:

arecord -d 10 -f cd -t wav /tmp/test-mic2.wav

Ripping shoutcast audio streaming

Streamripper allows us to rip audio streaming servers. Install it by typing

sudo apt-get install streamripper

You can connect to any shoutcast radio station with xmms. Once playing get the info and write down the url. Then type:

streamripper url

and you’ll get each song in a separate mp3 file.


Interesting audio applications.

Audacity-Editing mp3/ogg files

Streamripper-ripping audio streaming servers

Streamtuner-Stream directory browser


Record in flac

To record in flac it is essential to use arecord to create wav not raw output. So command is:

arecord -f cd -t wav | flac – -o /home/Bill/Music/out.flac

References

https://jordilin.wordpress.com/2006/07/28/howto-recording-audio-from-the-command-line/