There is a great utility for Linux/Unix called [vsound] to capture any audio going through /dev/dsp and write it as a wav file. To record your favorive radio show and make an MP3 you can do the following.
Start your stream player application passing a URL to a stream and a file name to write the file to.
vsound -d -f /location/file.wav /usr/local/bin/realplay http://www.radio-station.url/stream.ram
by default vsound catches the audio output and does not send it to the speakers, however the -d parameter tells vsound to to also send the audio output out to the speakers.
Once you have your wav file you can then use [lame] to convert the wav file into an MP3. Here is an example and a brief explaination of the options I use.
lame -h -b 128 /location/file.wav /location/other-file.mp3
The -h option tells lame to record slower but to produce a higher quality.
The -b option tells lame what bitrate to record at.
Then your input file (.wav) and your output file (.mp3)
Whala, you have your favorite show as an MP3 to take with you. I like to listen to the radio on my computer whenever I am home and from time to time I find I am scrambling to the computer to kill my realplay and then to restart it recording if something good suddenly comes on. Well all that scrambling makes me miss the beginning of a lot of songs so recently I wrote a little script to stop playing and start recording. If interested here is how I did that, creating a unique file name that I can use later to make an MP3 from.
#!/bin/sh
# KILL EXISTING INSTANCES OF REALPLAY
killall realplay.bin;
# WAIT A BIT TO MAKE SURE IT IS KILLED
sleep 5;
#START RECORDING
vsound -d -f /location/file-prefix-`date | cut -d’ ‘ -f1,2,3,4,5,7 –output-delimiter=’-'`.wav
/usr/local/bin/realplay http://www.radio-station.url/stream.ram &
So as you can see, this script simply kills the running realplay and then restarts it through vsound and I no longer miss the begining of my show ![]()
Enjoy!

Post a Comment