Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Music Media Software The Internet

Scheduled Recording of Streamed Audio? 61

sborisch asks: "I have tried at least 15 different Internet Radio/Shoutcast players, looking for one with a scheduler (recorder) capability that actually works. The closest I have found are IRadio and Replay Radio, but IRadio depends on the Windows scheduler, and isn't the least bit reliable in my test of it. Replay seems to want to send everything through your sound card, and hence makes it impossible to listen to something and record something else at the same time. It does have a so-called direct download option, but this doesn't seem to work either. Surely someone has found a better solution than this. Please let me know." How would you schedule a recording streaming audio from either Windows or Unix?
This discussion has been archived. No new comments can be posted.

Scheduled Recording of Streamed Audio?

Comments Filter:
  • MPlayer (Score:4, Informative)

    by thegrassyknowl ( 762218 ) on Thursday January 06, 2005 @06:23PM (#11281618)
    mplayer has -ao and -vo (audio out and video out) redirection options so you can dump streams to files on your disk. It plays all of the streams I have thrown at it in the past.

    Script it with cron?
    • or with some 3rd party timing program in windows.

      so mplayer in windows too.. (there's a port)
      • There is a port of mplayer to Windows - on the main mplayer site too. You could hack up your own timing program if you were bold enough. I'm sure there are (literally) hundreds of pre-existing scheduling programs for Windows.
        • I'm sure there are (literally) hundreds of pre-existing scheduling programs for Windows.
          Start->Settings->Control Panel->Scheduled Tasks since NT4. You can also try the "at" command from a command prompt. Try "at /?" (or "at 21:00 /interactive cmd.exe" for a NTAuthority/System user command prompt to open at 9PM - you can't do that from the GUI scheduler).
    • Re:MPlayer (Score:3, Informative)

      by TeknoHog ( 164938 )
      I've used MPlayer with a script that's called from my crontab. It is basically like this:
      mplayer -cache 8 -dumpstream -dumpfile $outfile $address &
      mpid=$!
      sleep $duration
      kill $mpid
    • nah no cron. He needs this [purplus.net] and this [purplus.net].
    • mplayer has -ao and -vo (audio out and video out) redirection options so you can dump streams to files on your disk

      mplayer -dumpstream <URL>

      would probably work better. Optionally, you can use '-dumpfile <filename>' to specify the filename to save as, otherwise it just names it stream.dump in the current working dir.
  • by Bravo_Two_Zero ( 516479 ) on Thursday January 06, 2005 @06:26PM (#11281650)
    ...or Streamripper + cron on *nix (or win32 with cron installed). Maybe I'm oversimplifying?

    http://streamripper.sourceforge.net/

  • I don't know how much this will help, but you can save streaming mp3/ogg radio streams using mplayer. "mplayer -ao pcm http://your.stream.here:port/" does the trick. This leaves an audiodump.wav file that can be converted via lame.

    It would only take about five minutes (if that) to hack together a shell script that does this all automagically for you.
    • This leaves an audiodump.wav file that can be converted via lame.

      That's nasty in that you're taking an ogg/mp3 stream, decoding it, saving it decoded, then re-encoding it later. You'll lose some quality and waste lots of CPU.

      Ideally you'd just save the stream that's downloaded. Sounds like that should be almost trivial to write up in perl, or you could use something like StreamRipper [sourceforge.net] rather than mplayer.

    • That works because those are open formats. But most streams are not in open formats, precisely because the people who own the streams don't want them recorded.
    • try
      mplayer -dumpstream
      The options -dumpvideo, and -dumpaudio don't work as expected.
  • Wait for MythRadio to come out.
  • Here is how I did it.

    Cron is your scheduler. man cron & crontab for more info.

    mplayer will playback many streams. Give mplayer the option to output the raw audio to a file which is a named pipe. Have lame take the named pipe as input and encode to mp3.

    Voila, You have a system that downloads and converts your streams straight to mp3 without any intermediate steps.

    Looks something like:

    /usr/local/bin/mplayer -ao pcm -aofile /tmp/myfifo rtsp://real.npr.na-central.speedera.net/real.npr.n a-centr

    • Give mplayer the option to output the raw audio to a file which is a named pipe.

      Ouch, I wish all my computers had a couple of gigs of memory. Named pipes are OK for data volumes up to a couple of hundred meg that you're going to use immediately or throw away, but if you're taking raw audio and saving it, those are potentially huge amounts of data, and if you're using a named pipe, there are data integrity issues should something happen like your cat walk across the keyboard or you lose power (like, you

      • You realise that pipes typically buffer only a few pages of data? (ie 4kB to 16kB). They certainly cant buffer hundreds of megs worth. In the case grandparent mentioned, mplayer is (in a sense) simply streaming to lame, which writes the mp3. The amount of data in flight will be tiny.
        • Named pipes are not |'s.

          Named pipes are...well..."named" FIFO structures on the filesystem whose contents reside in memory. Check this article [techtarget.com] for some more information.

          If he were using just a pipe, he'd be doing something like....

          mplayer blah blah | lame foo blargh

          That's not what he's suggesting here - he's suggesting using a named pipe as a temporary repository for your data stream, which is a bad idea, both for the strain on your memory, and the lack of integrity should your computer burp.

          • Named pipes are not |'s.

            Named pipes are...well..."named" FIFO structures on the filesystem whose contents reside in memory. Check this article for some more information.


            Yes, I know the difference between anonymous and named pipes - mostly none other than one being present in the filesystem namespace.

            That's not what he's suggesting here - he's suggesting using a named pipe as a temporary repository for your data stream, which is a bad idea, both for the strain on your memory, and the lack of integrity
            • Essentially, the original poster was spouting rubbish and probably had very little clue as to what he was on about.. ;)

              Oops, that was you. ;)

              Anyway, be aware that you cant portably expect a pipe/fifo to hold more than PIPE_BUF AFAIK. If you know of systems that can buffer hundreds of MiB in pipes, I'd be interested to hear which.
    • Hm... that mplayer command gives me

      Playing rtsp://real.npr.na-central.speedera.net/real.npr.n a-central/fa/20040316_fa_01.rm.
      Option stream url: This URL doesn't have a hostname part.
      File not found: 'real.npr.na-central/fa/20040316_fa_01.rm'
      Failed to open rtsp://real.npr.na-central.speedera.net/real.npr.n a-central/fa/20040316_fa_01.rm

      Exiting... (End of file)

      (of course, with no space in the "real.npr.na-central" part)

      Is there some magic you have to get mplayer to download rtsp streams?

      • A few things. First rtsp requires some ports to be open. So you have a firewall, it will need configuring. I do not remember where I found the information, but between google and netstat I'm sure you could figure it out. Second mplayer must be built with network support. If you are using gentoo it would require the "net" use flag. If it is a binary it's most likely built with. If I am not mistaken you will also need a package called Live. Sorry rtsp is extremely annoying.
        • Thanks for the reply. It was that my mplayer was built without the proper support. Gentoo has apparently added a bunch of USE flags since I last looked at it, and adding "network", "live", and "real" made everything work (along with installing the live package). Thanks again for your help!
  • by Bren ( 153085 )
    Use these two programs:

    http://streamripper.sourceforge.net/
    ftp://juri x.jura.uni-sb.de/pub/jurix/source/chroot /appl/at/

    Streamripper to download the stream, and at to schedule it for a single time. Use cron instead of at to schedule a recurring thing.
  • Total Recorder (Score:5, Informative)

    by Murphy Murph ( 833008 ) <sealab.murphy@gmail.com> on Thursday January 06, 2005 @06:43PM (#11281869) Journal
    For Windows Total Recorder http://www.highcriteria.com/ [highcriteria.com] will copy any audio stream - protected or not - on a schedule, or real time.
    • Re:Total Recorder (Score:1, Informative)

      by Anonymous Coward
      I use it to archive NPR programs like 'Car Talk' and 'This American Life' for later listening on my ipod. Total Recorder will save the stream as .wav, .mp3, .ogg, or many others.
    • Re:Total Recorder (Score:5, Informative)

      by fm6 ( 162816 ) on Thursday January 06, 2005 @07:31PM (#11282417) Homepage Journal
      I've used that one. It works very well, though the user interface is a little klunky. The interesting thing is that if you tell it to direct the recorded stream to disk without also playing it back, Real Player will start playing back the stream as fast as it can get it off the net. Doesn't make any different with a live stream, but if the server is pulling up a recording for you, it speeds up too. So if you, for example, record an old 30-minute NPR interview, the recording will only take about 20 minutes.

      Of course that brings up a nasty issue. NPR presumably makes a lot of money from the downloadable material on audible.com [audible.com]. If a lot of people started downloading that same material for free from the NPR web site, I suspect a lot of that material would cease to be available.

    • Agreed (Score:1, Informative)

      by Anonymous Coward
      Total Recorder is great software, and has an EXTREMELY reasonable registration price (~$12). The author(s) were very quick to add Ogg Vorbis a couple years ago, which is what convinced me to pay for it.
    • I second Total Recorder. I've been using it for two years and absolutely love it. It is very unique from most (all) other rippers for Windows in that it can record ANY sound that comes through your computer. I don't buy too much software but I gladly purchased the pro version from High Criteria.
    • Total Recorder http://www.highcriteria.com/ will copy any audio stream - protected or not

      Not necessarily. The Secure Audio Path, introduced in Windows ME and Windows XP, allows audio files to specify that they may be played only through signed audio output drivers. Microsoft signs audio drivers only if they always disable mixing Secure Audio Path audio into any cleartext digital output such as Total Recorder's .wav output. You may have to use the analog hole for some of the more restricted streams.

  • by fm6 ( 162816 ) on Thursday January 06, 2005 @06:44PM (#11281878) Homepage Journal
    To record a stream directly, you need software that translates the data from the stream into the format you want to save. Now, that's not very hard technically, assuming you're good at reverse-engineering and the stream you're trying to read isn't encrypted. But people who manage to do that always run into one major problem: as soon as they release their product, the owners of the streaming format are on them, telling them they're in deep legal dodo until they stop selling tools for "pirating" their customers' data.

    You can argue all you want about how legal or fair this is. But no developer has found it worthwhile to bankrupt him or herself in order to fight this kind of legal action. In any case, what's really needed is the political will to change the laws that favor IP hoarding.

    The only way around this problem is to record the sounds after it's been translated by authorized software. The simple way is just to plug a patch cord into your sound card. Or you can get better fidelity by using a special sound driver that copies the audio stream to disk. But either way, you can't avoid tying up your sound card, since you have to con the authorized software into giving you a stream that's supposedly going directly to your speakers.

    If you need real-time access to the recorded data, get two computers and a network.

    • If you are running windows, you do not need a patch cord. All you need to do is double click your "little yellow speaker", go to Options/properties then click the "recording" radio button and select "Wav Out". Click "ok" then select it as your recording source. you can then use recording software like Audacity to record anything that comes out of your comptuers speakers. The bad thing is that it records everything including any click noises, alert sounds and IM sounds. Also, I am not sure if Audacity ha
  • by szyzyg ( 7313 ) on Thursday January 06, 2005 @06:57PM (#11282020)
    Since this is Slashdot - people might have a perverse interest in how I recorded BBC radio to mp3 back in 96/97

    I had a good old fashioned FM receiver which I tuned into Radio 1, it got good reception, but not quite good enough for stereo. The output of this went into a Linux PC with a rather expensive signal capture device, which I'd rescued from the trash. This was an old fashioned ISA card which had a 20 bit ADC and I could tune the frequency to almost anything I wanted. This was used by some former resident of the observatory for some scientific work, but, being scientific grade it made an excellent sound card. At least a lot better than the built in sound on my Alpha workstation.

    It was installed in an old 486 DX2/66 running linux, I had to write my own driver, I had a lot of time on my hands. This was great for capturing audio, but it didn't have enough disk space for the show or enough CPU for real time mp3 encoding.

    Instead I encoded it using Shorten and piped it across the network to a more modern PC which had a couple of gigs of disk space, I could get about 8-10 hours of mono audio on there.

    This host would then decode the SHN data and encode it to mp3 using Fraunhofer's l3Enc - a very early command line mp3 encoder which was available for linux. I ran this in the highest quality mode available, since the data was already stored in SHN format. I don't think that there were any machines that could reliably encode realtime mp3 at that time, so this 2 stage process was needed.

    Ultimately, I stored the essential mix files to a RAID array made up of 6 1Gig SCSI disks, these disks were mounted in pairs inside cases which were about the size of a PC.

    I am recalling this archaic procedure as I'm backing up my entire Essential mix collection to a 300gig disk which is about the size of a book.

    Moore's Law Rocks!

  • For non MP3 formats (Score:4, Informative)

    by RotJ ( 771744 ) on Thursday January 06, 2005 @07:17PM (#11282261) Journal
    Streambox VCR [afterdawn.com], which was sued out of existence by RealNetworks years ago [slashdot.org], still works for Real audio and video streams, as well as for Microsoft's streaming formats. Here [wanadoo.nl]'s a manual for it.
  • by t482 ( 193197 ) on Thursday January 06, 2005 @07:23PM (#11282339) Homepage
    a post from my weblog:

    Recording Realaudio, WMF, OGG & MP3 Radio streams on your Linux box

    I wanted to record a couple of radio shows so that I can listen to them later on my linux machine. Basically I would like to listen to a mix of realplayer, Windows Media, Ogg and MP3 streams and save them as mp3 or ogg files so I can listen to them later on my computer or iriver ogg/mp3 player.

    First I tried mplayer's dumpstream command

    1) mplayer -dumpfile cores -dumpstream http://wm.warnermusic.com/France/the_corrs/summer_ sunshine/video/Summer_Sunshine_video_458.wmv
    (thi s will give you a file called "cores" in your home-directory)

    2) mplayer -vo null -vc null -ao pcm -aofile audio.wav cores
    (this will convert the videofile to a wav audiofile)

    3) lame audio.wav cores.mp3
    (this will convert the file from wav to mp3)

    However this process core dumped on realplayer recordings over 10 minutes. Also it doesn't know about ram files so you have to download them first (wget filename) and then open them to file the real link to the rm file. So I went on to look for some other tools.

    Most of the tools seem to be wrappers around vsound and/or sox and lame/oggenc. Another tool I looked at is streamripper, which works for mp3 or ogg streams.

    First I grabbed realcap which is a shell script front end to those tools. Downloaded, compiled and installed vsound.

    Trick one - you have to ensure that realplayer is using OSS drivers
    http://www.osl.iu.edu/~tveldhui/radio/

    After that seemed to work I tried directly with vsound. vsound acts as a kind of virtual audio loopback cable ... it allows you to record the output audio stream of ... and line out jacks on the sound card.

    vsound --timing -f myfile.wav realplay http://www.radio.org/ra/show.ram
    oggenc myfile.wav
    xmms myfile.ogg

    I also checked out the trplayer - which is a command line wrapper to realplayer. http://www.linux-speakup.org/trplayer.html.

    Got the error:
    Failed to load rmacore.so.6.0: /usr/lib/RealPlayer8/Common/rmacore.so.6.0: Cannot open shared object file: No such file or directory

    Well I figured out that they must be looking for the real player in /usr/lib when it was in /usr/local/ so I copied the directories over to where it wanted to find them and everything worked ok.

    Also I tried out streamripper
    http://streamripper.sourceforge.net/ , which seemed to work fine ripping various streams. It didn't seem to be able to read the .m3u file so I had to download the m3u file with wget and look at it and then use streamripper http://url.ogg for it to work. Cool - now I can listen to the BBC, NPR, CBC, ABC (Australian Broadcasting) and Netherlands Broadcasting when I want to and where I want to.

    Finally I had a look at mp3record - a bash shell wrapper for lame and sox
    Basically it does this:
    (sox -r $strFreqRate -t ossdsp -w -s /dev/dsp -t raw -c 2 -
    | lame -s 44.1 -x -b $strBitRate -m s - $strFileName) &
  • I would use at (sheduling demon aviable on most unices) and streamripper (for MP3) streams. Or for saving stream I would use mplayer (since it can probably handle most streams well) with pcm as output and {insert your favourite audio encoder here} for audio encoding... And probably glue it all together with some little shell script. Maybe run it on server which is always online and has proper storage and processing power... This is actually an easy thing to do, no need to make it complicated running in GUI.
  • Mac tools (Score:4, Interesting)

    by dourk ( 60585 ) on Thursday January 06, 2005 @07:43PM (#11282563) Homepage
    If you've got a mac, try audio hijack [rogueamoeba.com] for grabbing the stream (from any software).
  • Using ALSA's built in tools and ability to record straight to HD from a sound application, you just use cron to kick it all off.

    I also used to use cron + esd to grab realaudio and mp streams. It's actually scheduled stream ripping this guy is after and right now there are a multitude of ways to do it in Linux. Windows isn't as easy, which is not to say Linux is any easier. But if you persevere, you can make it work. I used stream ripping to grab the latest RealAudio streams of the new HHGTTG to Ogg Vor
  • bleucanard (Score:3, Interesting)

    by neolith ( 110650 ) on Thursday January 06, 2005 @07:53PM (#11282680) Homepage
    I've been doing this for sometime, recording about an hour of 3WK [3wk.com] each night for listening to on the way to work. I've used bluecanard's [mark1hosting.net] freeware software sound recorder [mark1hosting.net]. It converts any sound on your system to MP3, and is command line driven. So, I just make a batch file that opens up the stream in my browser, then wait a few seconds, and fires off the commands to record it.

    Although, now that I notice it, it seems they have a beta version of an internet radio recorder that would be right up your alley, and mine too. Answered a question, and learned something new and beneficial myself. Wow, gotta love how THAT worked out.
  • by Anonymous Coward
    Save yourself, pirate!

    Of course, unauthorized duplication of content, including so-called "time-shifting" is against the law.

    We are fully aware of your activities. We can dispatch agents to your home at any time. And we will.

    However we are merciful. We will give you time to mend your ways. Simply visit the nearest Copyright Enforcement Station and confess. We will release you soon after, given you a second chance.

    Simply do this and destroy your illegal copies, and you will be spared.

    We see and know all
  • This works:
    $ wget http://example.ca:8000 -O download01.mp3
    so schedule this command and "Bob's your Uncle".
    --
    Tonight on CBC Zed T.V. Revolution O.S. [zed.cbc.ca]
  • I just did the same thing for a Real Video stream that is put up for democracy now everyday at 12. At 1:00, cron runs a script I wrote that uses mencoder.

    Basically, the script just sets the file name based on the current date. The mencoder command is this:

    $ mencoder -ovc lavc -oac mp3lame (url) -o

    Which records and reencodes the stream. This has worked out extremely well. Hope this helps.
    • I have been messing with a few options for a while, including the above software options.
      I finally went out and purchased radioshark
      http://www.griffintechnology.com/produ cts/radiosha rk/

      It has an underpowered interface, but it works well.

  • It may be worth having a look at HiDownload [streamingstar.com]. If seems to be able to handle pretty much any format, and scheduling is built-in. It's got a decent evaluation period; I've been using it for quite a while, but have only just purchased it. Plenty of time to at least see whether it does what you want...
  • NetTransport (Score:2, Informative)

    by s4f ( 523726 ) *
    NetTransport [xi-soft.com], it's the Holy Grail of media downloading. The scheduler works well when you get past its idiosyncrasies, but all in all, it's the best tool I've found. And I've been looking for years.
  • Net Transport [xi-soft.com] from XI-Soft [xi-soft.com] will schedule downloads. It supports http, rtsp, and mms. It also has FlashGot integration for Firefox, which makes it super easy to add streams. Give that a look.
  • Applian has two different recording solutions for Windows:

    Replay Radio works well by recording sound coming out of your speaker, and can tune to any audio URL. It comes with a Guide of almost 1000 shows and stations, and is easy to use. It saves MP3 files, or lets you add a post-processing command to run your command-line encoder to make WMA, OGG, etc.

    http://www.replay-radio.com/ [replay-radio.com]

    WM Recorder and RM Recorder record raw Windows Media and Real streams (video, too), and come with a VCR-program when you
  • mplayer --dump-stream

    the four words version is:
    at
    mplayer --dump-stream
  • This is a tangental question.

    I have looked at setting up a stream of my music collection for my enjoyment. I'd love sometype of web based frontend that would allow me to add/drop songs from the stream; add wieghting scores to a song, such that ones I really like are played more often than others; and be able to feed to stream output to someplace like Shoutcast [shoutcast.com] or Live365 [live365.com].

    And, the killer, I want this tool to be open sourced on Linux, eliminating tools like WinAMP [winamp.com].

  • by anewsome ( 58 ) on Friday January 07, 2005 @04:44PM (#11290911)
    I record the Jim Rome radio show from my streaming server at home every day on my work PC. I've done this for over 4 months and never missed a momment of the show.

    In crontab:
    0 9 * * * /usr/local/bin/recordRadio 1 1>/dev/null 2>&1
    0 10 * * * /usr/local/bin/recordRadio 2 1>/dev/null 2>&1
    0 11 * * * /usr/local/bin/recordRadio 3 1>/dev/null

    It's a three hour show, I create three seperate files because it's easier for me that way. /usr/local/bin/radioRecord:

    #!/usr/bin/perl -w
    # $Id: radioRecord,v 1.3 2004/10/19 18:37:29 anewsome Exp $
    use strict;

    my $num = $ARGV[0];
    my $time = 3600;
    my $date = `date +%F`;
    $date =~ s/\n//g;
    my ($year, $month, $day) = split(/-/, $date);
    my $cmd = "mkdir -p /radio/$year/$month/";
    system($cmd);
    my $file = "/radio/$year/$month/Jim-Rome-$year-$month-$day-$n um.wav";
    my $timedOut = 0;
    my $pid;
    my $command = qq~/usr/bin/ogg123 -d wav --file "$file" http://myhost/dss.ogg~;

    $SIG{ALRM} = \
    if ($pid = fork) {
    #print "Launched pid: $pid\n";
    } elsif (defined $pid) {
    exec("$command");
    } else {
    die "Can't fork for some reason\n";
    }

    alarm($time);
    while (1) {
    if ($timedOut == 1) {
    #print "Timeout, killing $pid\n";
    kill INT => $pid;
    exit;
    }
    select(undef, undef, undef, 0.25);
    }

    sub timeOut {
    $timedOut = 1;
    }

Real Programmers don't eat quiche. They eat Twinkies and Szechwan food.

Working...