Record Play And Convert Audio In Linux
By lsgondane
Most of us use GUI (Graphical User Interface) to record, play and convert audio, but I would like to discuss how you can do the same with CLI(Comand Line Interface)
First make sure “sox” and “aumix” packages are installed, if not you can download the package from http://rpm.pbone.net. Now use it to set both the record and play volumes. Make sure the microphone is the recording device and is on ‘mute’.
Now open a terminal and follow the following instructions
To record a song from the microphone, execute the following command:
#rec mysong.au
If you want to change the volume, use the –v flag with the command, which can be a float where >1.0 amplifies, and <1.0 attenuates. For example:
#rec –v2.0 mysong.au
To play it back, execute the following command:
#play mysong.au
To sotp playback, you can just press “Ctrl+c”. Finally, to convert it to a WAV file, or any other supported format, execute the following command:
#sox mysong.au mysong.wav
If you want to compress your files further you can install a package “lame”. You can download the package from http://sulphur.freshrpms.net
Use the following commands to convert your audio files to mp3:
# lame -q 2 --tt Numb --ta Portishead --tl Dummy --ty 1994 --tn 7 orignal.wav converted.mp3
To record as an mp3 audio file we can use sox and lame together:
#sox -t ossdsp -w -s -r 44100 -c 2 /dev/dsp -t raw - | lame -x -m s - ./first.mp3
For more help please use man pages for all the commands.
Comments
No comments yet.