Remove these ads by
Signing UpStep 1: Get Ubuntu, create directories
If you already run Ubuntu, the only things you need are freely available through apt. Use the following commands at a terminal to install Lame, Mplayer and KCron.
sudo apt-get install lame mplayer kcron
Type in your password and confirm the installs.
Use the following commands to create the folders you'll need.
sudo mkdir /scripts
mkdir /home/username/Music/NameOfShow
And this command to take ownership of the directory you just created:
sudo chown YourUserName /scripts









































Visit Our Store »
Go Pro Today »




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 -endpos "01:00:00";
This would record for 1 hour and stop. A bit cleaner than using kill, plus one less line in crontab.
mplayer $STREAM -endpos $DURATION -vo null -ao pcm:waveheader:file=$FILENAME.wav
Where $DURATION is of the form "1:30:00"
More details:
http://www.mbeckler.org/scripts.php#savestream
For background, I'm thinking about setting up a an Ubuntu box just so I can do this. I would set it up to record NPR and another show I like, then save the OGG file to my Ubuntu One account so I can access it from abroad really easily (I'm going on a big trip).
Now, I have changed to use the tool mimms. It works great for me. Since mimms has the option to specify the length of recording in mintue. No need to have 2 cron jobs for each recording anymore.
- Mac
thanks
What stream are you accessing? I have no problems getting to a local radio station, that stream is encoded as an asf. How exactly are you invoking this stream from the command line? I tried this:
cd /scripts
sh streamrecord
and it worked fine, then tried it in kcron using 'run now' command, and again had no problems. Please try again to manually launch the script and see if you can get it to fail. I'm more interested in launching the actual script, not just
mplayer url.
Let me know if this sheds any light on your problem. Thanks,
Shawn
03 00 * * 2-6 script URL filename
I edited it to redirect output/error messages like so:
03 00 * * 2-6 script URL filename > $HOME/logfile 2>&1
Now it works just fine! By the way, there's some useful info here that I've used together with your how-to in order to record directly to ogg/mp3 without creating a temporary wav file: http://www.tomtaylor.co.uk/blog/2007/04/17/play-it-again/
Thanks again, it's so cool to be able to record streams automatically.
John.
Looking forward to listening to the radio show tomorrow that will be recorded while I snooze tonight!
all the best,
john.
http://www.xaudiotools.com/