Instructables

Linux command line audio.

Picture of Linux command line audio.
What we would like to do is to be able to listen to podcasts and music from either the internet or over the air.You should even listen to files being spoken. Just because you do not have a fancy graphics card does not mean you can not listen to music. Another reason to like this as most of it excepting the sound recording (untested) can be done remotely!

What's needed:

Linux based computer.
A supported sound card.
Speakers or headset.
Microphone(s).
FM radio card ( or analog tv capture card that has a radio tuner.

Note: can do this on a gui based machine from a terminal also. If you are visually impaired, instructables like this can be very important.
 
Remove these adsRemove these ads by Signing Up

Step 1: Command line sound recording.

Picture of Command line sound recording.
You may want to record sound or even take oral notes for later playback, create your own podcast, or even create a podbook. I do this for lecture recording.


$ sudo apt-get install sound-recorder

When recording from the command line the command is:


  $ sound-recorder -c 2 -b 16 -P -S 5:00 recording.wav

The options set stereo recording (-c 2), 16 bit sampling (-b 16), priority threading (-P) to ensure high priority in CPU usage, and limiting the recording to 5 minutes. The output is written to the file recording.wav.

Many of these options are the default so you can simply:


  $ sound-recorder -P recording.wav


or use

arecord: Linux Command to List all Soundcards and Digital Audio Devices

Here is a quick way to list all detected and working soundcards. Use arecord command line sound recorder and player for ALSA soundcard driver. The -l option List all soundcards and digital audio devices. The -L option list all PCMs defined. The information obtained from following command can be used to play various media files [...]


Record:

$ arecord filename.ext

Playback:

$ aplay filename.ext

pfred22 years ago
You missed one of my favorites.

SoX(1) Sound eXchange SoX(1)

NAME
SoX - Sound eXchange, the Swiss Army knife of audio manipulation

Computothought (author)  pfred22 years ago
You are right but sox deserves and instrictable of it's own. This instructable was not really about sound manipulation.