Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Ripping streamed audio to .mp3

  1. #1

    Lightbulb Ripping streamed audio to .mp3

    This is my first ever contribution to the Ubuntu Community…

    How To: Capturing streamed audio as .mp3

    Why?

    Internet radio stations are a rich resource. More and more of them are archiving their audio material. Sometimes this can be simply downloaded, simply as a Podcast (usually .mp3, sometimes .ogg). More often the audio is ‘streamed’ – i.e. the file plays directly but can’t be saved.

    This guide tells you how to capture Real Audio .ra and .rm streams (the most common kind).

    Some stations also stream .mp3 and .ogg. There is a separate guide for those, susing StreamTuner and StreamRipper, here.
    You can also record the audio from the sound output using something like Audacity – but the quality is limited by your sound card. With this method you’ll be grabbing the digital audio stream file directly. This process is called ‘Ripping’, as opposed to ‘Recording’

    NOTE: In most countries it is legal to capture streamed audio, provided that this is for personal use and not for further duplication or commercial re-use. However - note the comments here. Use at your own risk.

    Steps
    1. Install Real Player. - this is the easiest way to listen to the audio steams
    2. Install the other software you’ll need – Vsound and Sox to grab the audio stream. Lame to convert it to an .mp3.
    3. Find an audio stream – it can be slightly tricky to find the URL
    4. Capture your stream - you'll end up with a large .wav file.
    5. Convert your stream to a .mp3 file - to shrink it down to size and make it work on your portable player.


    How to install Real Player

    Real Player is a proprietary package. For information on how to install it, read here. You will also need to configure it to play Real Audio formats. Read the Real Player section here.

    Install the other software you’ll need

    Read here for general instructions on how to install software.

    The packages you need are vsound, lame and sox.
    • Vsound grabs audio streams
    • Sox converts them to a very large .wav file
    • Lame is a handy package for converting most audio file types to most others.

    You may already have these installed. Otherwise, with Universe and Multiverse repositories enabled, type the following in a terminal window:
    Code:
    sudo apt-get install vsound
    Code:
    sudo apt-get install sox
    Code:
    Sudo apt-get install lame
    And you’re ready to start looking for audio streams.

    Finding your Audio Stream.

    Vsound needs to know the URL of the audio stream it is grabbing. This may not be obvious at first glance.
    For example, some sites, like NPR (eg here), nest the URL inside a .smil (Standard Multimedia Integration Language) file. If you click on the links you will be offered the .smil file to either play in Real Player or save to disk. Save it. Then open it with a text editor (right-click). Inside, you will see the URL.

    Elsewhere (eg. BBC Radio, here ) you will be offered a .ram file (On the BBC site, right click on 'Play in standalone Real Player' buttons). Again, save it locally and peek inside using a text editor.

    In either case you’re looking for a URL which ends with a something.ra or something.rm filename.

    Select and copy the URL.

    Capture your Audio Stream

    Now let’s get to work.

    NOTE: before you start, you are going to me making some massive .wav files – approx 10MB per minute of recording. Make sure you have enough disk space for the time you want to record. You’ll need about (2.1 x 10 x recording length in minutes)MB.

    Open up a terminal window:
    Code:
    vsound –d –t –f myfilename.wav realplay url_of_the_stream_you_want_to_rip
    Realplayer will open up and play the stream (the –d parameter means you can listen while ripping). At the same time, it will generate a large Sun ULAW format file containing the stream. When it’s got what you want, close down Real Player. Sox will start up, create a .wav file from the ULAW, then delete the ULAW. This may take some time – but you can monitor it in a file browser.

    Converting to .mp3

    To convert the massive, unwieldy .wav to a more manageable .mp3 (approx 10% of its size), simply:
    Code:
    lame myfilename.wav myfilename.mp3
    A dialogue will open in your terminal showing the process. Again, this may take time, depending on your processor speed and the file size. You can use Audacity to edit the .mp3 further – eg to make breaks between songs.

    This information was based in part on the following article: http://www.linux-magazine.com/issue/...io_Streams.pdf

    NOTES
    There is an alternative method just using mplayer and lame here:
    http://www.ubuntuforums.org/showthread.php?t=40193

    btw: I’ve structured this file in a particular way which I believe is a good model for How Tos:
    Why – start by explaining why the reader might want to follow it: what real world problem will it help with.
    Steps – break it up into manageable steps. List each one and explain what it’s for.
    Main body – keep it brief and simple, explaining what you’re doing as you go along.
    Link to other related info. as appropriate.
    Last edited by Edward The Bonobo; May 5th, 2006 at 01:28 PM.

  2. #2
    Join Date
    Apr 2005
    Location
    Sussex, UK
    Beans
    277
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Ripping streamed audio to .mp3

    Nicely written!

    There is an alternative method just using mplayer and lame here:
    http://www.ubuntuforums.org/showthread.php?t=40193
    The Free Software war is won, all else is now maneuvering
    http://brainstorm.ubuntu.com/idea/27361/image/1/

  3. #3

    Re: Ripping streamed audio to .mp3

    Excellent! I'll link it. A question, though...does the mplayer method bypass the soundcard? That's a major consideration for me, because I have an ancient, crappy, low-spec machine.

    Thanks for the compliment about the writing. I have a bee in my bonnet. I'm a newbie and not much of a geek. My learning curve has consisted of a lot of figuring out which bits I do and don't need to know to get my machine into a state where I can use it as a useful life tool. I reckon that HowTos should start with "Why would anyone want to know this?" The explanation should focus on the end benefits.

    ie not
    libgobbledygook is a thrunge grocket for Gwhoosit libraries
    but
    If you install this, it will make it faster to convert music files.

  4. #4
    Join Date
    Apr 2005
    Location
    Sussex, UK
    Beans
    277
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Ripping streamed audio to .mp3

    Well it doesn't play the output so I guess it bypasses the sound card, (hence the data dump in step 1).

    The best way to learn linux is to find something that bothers you and try to fix it. I've learnt shed loads about grub, acpi, sound cards, graphics just by playing with it on my laptop....and how to reinstall

    I agree that functionality should be above techy speak. Luckily the ubuntu great and the good seem to share this. I have to say this is one of the most approachable and friendliest groups in linux.
    The Free Software war is won, all else is now maneuvering
    http://brainstorm.ubuntu.com/idea/27361/image/1/

  5. #5
    Join Date
    Mar 2006
    Location
    Winnipeg, Canada
    Beans
    365
    Distro
    Ubuntu Intrepid Ibex (testing)

    Re: Ripping streamed audio to .mp3

    and gentoo - gentoo has an amazing community. maybe even better than ubuntu's?

    nice HOWTO, just what I was looking for!

    i've always had trouble getting podcasts to work for me. not in windows, back in the day, and not in linux, either. this sidesteps the whole podcast issue! (provided that the podcaster has streamed content as well)

    cheers,
    groggyboy
    Last edited by groggyboy; May 5th, 2006 at 09:57 PM.

  6. #6
    Join Date
    Apr 2005
    Location
    Sussex, UK
    Beans
    277
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Ripping streamed audio to .mp3

    gentoo has a special 'techy' status. There is nothing that those guys can't do.

    Aww shucks you're all great!!!
    The Free Software war is won, all else is now maneuvering
    http://brainstorm.ubuntu.com/idea/27361/image/1/

  7. #7

    Re: Ripping streamed audio to .mp3

    With the danger of this turning into a mutual backslapping fest...

    (I was going to type 'circle jerk', but thought better of it)

    It's the communities that have kept me going these last few months. The learning curve is damned steep for a non-techie like me. Luckily community support is part of the package.

    NEXT SELF-SET PROBLEM

    Some stations only stream live - expecially when issues of music licencing are involved. So I need to set up some kind of timer routine which will start up vsound while I'm out/ in bed. Then...because the files get big...it will have to kill Real Player after not too long.

    Any ideas where I should start?

  8. #8
    Join Date
    Feb 2006
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Ripping streamed audio to .mp3

    VLC has also capability of capturing streams and transcoding them to mp3.
    Vera! Vera! What has become of you?

  9. #9

    Re: Ripping streamed audio to .mp3

    That sounds promising - especially if it can transcode directly to .mp3 without the intervening .wav stage.

    The documentations a little confusing, to my non-geek eye. Can anyone point me at a How To? (or, in general, more info.)

  10. #10

    Re: Ripping streamed audio to .mp3

    It says here that VLC doesn't support Real audio formats.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •