3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Schedule Streaming Audio Recordings in Ubuntu

Step 3Save script, make pkill script and make scripts executable

Save script, make pkill script and make scripts executable
Next, we'll save the script to the /scripts directory. Once saved, go to a terminal session and type the following:

cd /scripts

chmod 700 streamrecord (This makes the script you just created into an executable file.)

Create one more file in the /scripts directory. This will be called pkill, and will be your hitman. That is, it will kill the mplayer process to allow the first script to continue with renaming and encoding the captured stream. The full text of the pkill script is exactly as follows:

pkill mplayer

Now, this breaks scripting etiquette, by not having #!/bin/sh at the top, but it works for me. Once you've saved the file pkill in the /scripts directory, use the chmod command again to make this one executable. You need to be in a terminal session, in the /scripts directory first, then type:

chmod 700 pkill

A quick "ls" will show you the files you just created, now in a lovely green instead of the standard black.
« Previous StepDownload PDFView All StepsNext Step »
3 comments
Jul 30, 2008. 12:11 PMMSpirit says:
Another way is to use the "endpos" option of mplayer instead of pkill script, i.e.
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.
Aug 24, 2011. 6:22 PMjulietmoss2011 says:
How about recording streaming audio with sound recorder? Perhaps somone will guess this will be illegal. I mean yes it might be if you record streaming audio for the sole purpose of spreading the recordings everywhere on the internet. As long as you do not spread it in any illegal form, it will be a hand way to help you out.

Dec 27, 2008. 12:33 PMNimoTh says:
I tried and googled. endpos doesn't work with -dumpstream. You have to revert to kill using the pid.
Jan 6, 2010. 2:05 PMmatthewbeckler says:
I've had good luck with something like this:

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

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
32
Followers
10
Author:stuffman