Step 2Create Streamrecord Script
1. Open mplayer, point to audio stream on Internet
2. Record stream to wav file in /tmp directory
3. Kill mplayer process when show ends
4. Convert /tmp/mystream.wav to mp3 file, name it with today's date and move it to more 'user-friendly' directory under user folder.
5. Delete wav file in /tmp directory.
To achieve this, you'll first need to find out the URL of the stream you're accessing. For an example, I'll use the CSPAN radio stream, and record it between the hours of noon and 2pm Monday thru Friday. Here's the text of the script:
#!/bin/sh
NOW=$(date +"%b-%d-%y")
mplayer "mms://rx-wes-sea20.rbn.com/farm/pull/tx-rbn-sea34:1259/wmtencoder/cspan/cspan/wmlive/cspan4db.asf" -ao pcm:file=/tmp/mystream.wav -vc dummy -vo null ;
lame -m s /tmp/mystream.wav -o "/home/shawn/Music/CSPAN/My Show - $NOW.mp3" ;
rm /tmp/mystream.wav ;
Copy this text to a blank file using Gedit or Vi, and save it as "streamrecord". You'll need to edit the areas of the script in italics, as these wont apply to you. The text after mplayer is the URL to the stream you want to record, this will need to be replaced with your stream's URL, which can be found easily by going to the stream in Firefox, letting the mplayer plugin start, then right-click and choose "Copy URL".
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|









































