Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Hardware Hacking Entertainment

Realtime Audio Conversion And Serving 153

Hobadee writes "First of all, Happy Christmas and Merry New Year! This year for Christmas, my dad and I decided to give my mom a Linksys WMLS11B. (Radio which can play MP3 streams) Since my mom listens to a lot of international news radio on the Internet, we figured this would be great so that she wouldn't have to sit at the computer all the time. The problem is that most of the stations she listens to are either RealMedia or Windows Audio streams, while the player only supports MP3 streams. (It claims to support WMA, but we haven't had any luck in our fiddling yet.) So here is the question: Would it be possible to get other types of files to play on the device? My idea is to have an intermediate server download, convert to MP3, and re-stream the files, but I'm not sure of the implementation. Would this be easily do-able with something like Icecast and Lame?"
This discussion has been archived. No new comments can be posted.

Realtime Audio Conversion And Serving

Comments Filter:
  • Easy as pie (Score:5, Informative)

    by perlionex ( 703104 ) * <[joseph] [at] [ganfamily.com]> on Saturday December 25, 2004 @10:44PM (#11183073)

    I did something like this for my office, streaming Christmas music using Icecast, Lame, and Shout. Here's one possible installation:

    1) Setup Icecast as usual. Take note of the encoding password.
    2) Install the Shout Perl libraries.
    3) Use the example2.pl that comes with Shout.

    For the example2.pl, I think it comes with the basic Perl library installation). By default it takes it the MP3 files specified on the command line, uses LAME to convert them to a bitrate you specify, and sends them to a mountpoint on the LAME server. I modified mine so that it loops indefinitely, and of course I hardcoded my Icecast IP address, mount point, and encoder password. You'll probably need to tweak it a bit to convert OGG / WMA / RM streams as well, but it should be fairly straightforward.

  • by seanadams.com ( 463190 ) * on Saturday December 25, 2004 @10:44PM (#11183074) Homepage
    SlimServer / Squeezebox [slimdevices.com] does precisely what you're asking for.

    You might be able to get it to work with the WMLS11B if that device is capable of playing an arbitrary mp3 stream by URL, as SlimServer can convert and rebroadcast streams in
    various formats.

    But if you have the Squeezebox it will work so much better, because it's designed to do all of this, and you can choose the stations (or your own music collection) from the display.

    SlimServer is also open source, so it supports just about every file format and radio format in existence. There is a free emulator included, SoftSqueeze, that you can use to try it
    out.

    PS I work for Slim. Mod up if you want me to answer questions in this thread; mod down if you don't care for self-promotion.
  • Possible (Score:4, Informative)

    by respite ( 320388 ) on Saturday December 25, 2004 @10:45PM (#11183077)
    It is definitely doable, but would require a time offset. Transcoding the streams would cause a loss of quality and could not be done entirely realtime.
  • Darkice (Score:5, Informative)

    by meekjt ( 94667 ) on Saturday December 25, 2004 @10:48PM (#11183089) Homepage
    Check out http://darkice.sourceforge.net/ You should be able to get it to do what you want.
  • I have an idea (Score:0, Informative)

    by Anonymous Coward on Saturday December 25, 2004 @10:50PM (#11183095)
    Whats better?

    1. Asking thousands of slashdot pundits who have no clue how to help you, hope that your question gets posted somehow, wait for it to get posted, wade through the hundreds of sarcastic replies in a hopeless effort to try to find some inkling of an answer to lead you in the right direction

    or

    2. Do a google search

    You decide!
  • Simple. (Score:5, Informative)

    by seinman ( 463076 ) on Saturday December 25, 2004 @10:55PM (#11183114) Homepage Journal
    One of the default options in Winamp's Shoutcast plugin is to broadcast from the sound card mixer. Wether it's microphone, line in, or WAV, it encodes and broadcasts it. Install the server, install the plugin, start streaming, then play whatever station you want to hear through whatever player you need to use. Shoutcast/Winamp handles the rest.
  • ffmpeg (Score:3, Informative)

    by GiMP ( 10923 ) on Saturday December 25, 2004 @11:01PM (#11183140)
    FFmpeg may do what you want. It will take a file and convert it in realtime to various other formats (and stream them).

    Another options would be any media streamer like icecast.

    If none of these let you specify a media stream as a source input, you can convert it by a line-out -> line-in hack.
  • Winamp (Score:5, Informative)

    by n17ikh ( 750948 ) on Saturday December 25, 2004 @11:03PM (#11183145) Homepage
    If you have a random Windows box sitting around doing nothing, you can setup Winamp along with Shoutcast to achieve exactly what you want. Use WA to listen to your streams/play songs and just have Shoutcast rebroadcasting all the time as a high-quality MP3 stream. So simple any idiot can do it, even me.
  • Blogmatrix Sparks (Score:2, Informative)

    by ratpack91 ( 698171 ) on Saturday December 25, 2004 @11:03PM (#11183151)
    Just started using it this week. Records stations to MP3 using a schedule. Pretty good and has loads of stations preset like all the bbc ones by show.
    "Use BlogMatrix Sparks! to record streaming Internet radio feeds and download podcasts and store them in your media player (iTunes or Windows Media Player). Sparks! uses an interactive directory of radio stations and podcasts to help you find content. Sparks! runs on Windows, Macintosh OS 10.3 and Linux and is open source software."

    http://sparks.blogmatrix.com/ [blogmatrix.com]
  • It's quite simple. (Score:4, Informative)

    by Guspaz ( 556486 ) on Saturday December 25, 2004 @11:05PM (#11183159)
    All you need is a copy of Winamp and the Shoutcast server/DSP. Have Winamp tune into whatever source you want (In the case of proprietary stuff like Real Audio you'd have to have the realaudio player to play, and set Winamp to record off "wave"), then use that same copy of Winamp to just stream via shoutcast.
  • by Anonymous Coward on Saturday December 25, 2004 @11:13PM (#11183187)
    a litle program called totall recorder will record any sound you hear on a sound card it will do it in mp3 format if that helps it cost about $12 us

    http://www.mp3-converter.com/total_recorder.htm
  • by Joe Tie. ( 567096 ) on Saturday December 25, 2004 @11:19PM (#11183205)
    To convert realaudio, I use mplayer -vo null -ao pcm -hardframedrop filename.wav To convrert the realaudio to a wav, then oggenc to convert to vorbis. Not sure how well it'd work from a live stream though, as I usually download archived episodes of radio shows.
  • Low Tech (Score:5, Informative)

    by AndroidCat ( 229562 ) on Saturday December 25, 2004 @11:27PM (#11183228) Homepage
    I would have gone for a low tech solution by pluging the computer's audio line-out into a FM wireless mic/transmitter. It's not as fancy, without remote control and bells and whistles, but costs less and could be listened to by any FM radio in the house. (And neighbouring houses depending on your power and antenna.)
  • by seanadams.com ( 463190 ) * on Saturday December 25, 2004 @11:28PM (#11183230) Homepage
    Source code for codecs included?

    Generally no, except for free (FLAC) [sourceforge.net] or trivial (WAV/AIFF) encodings, which are built-in.

    SlimServer's trick is to take advantage of thrid-party codecs which are installed on your computer. This allows us to support Apple Lossless, for example, by leveraging Quicktime (Windows or Mac). The same goes for WMA. MP3 encoding is automatically enabled if a lame installation is detected.

    It's all quite automatic - nearly always, if someone has Apple Lossless or WMA files, then they'll have Quicktime or Windows Media, respectively, installed. So whichever formats you're using will "just work" with SlimServer.

    If we wanted to pay Fraunhofer "per anum" then we could distribute Lame, but it's easy enough to install separately.
  • by seanadams.com ( 463190 ) * on Saturday December 25, 2004 @11:36PM (#11183249) Homepage
    Your site says it supports WMA but the submitter also mentions RA.

    WMA definitely; RA "no, but possible". Real's software is quite closed and inextensible (yes, even compared to MSFT), and I don't think there's a solution for this yet. All it would take though is a decoder app, and you could hook it in in five seconds using SlimServer's transcoding logic [slimdevices.com]. Take a look to see specifically which formats are supported.
  • by Anonymous Coward on Saturday December 25, 2004 @11:42PM (#11183270)
    VLC Stream output:

    http://www.videolan.org/streaming/features.html [videolan.org]
  • by t482 ( 193197 ) on Sunday December 26, 2004 @12:15AM (#11183385) Homepage
    From a blog entry I wrote a few weeks ago:

    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 recorder 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/ [iu.edu]

    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

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

    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/ [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 and CBC and 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) &

    Things to get working...
    1) streaming directly to ogg with no intermediary wav step.
    2) see if I can get this running from a cron job...
  • by apdt ( 575306 ) on Sunday December 26, 2004 @12:23AM (#11183416)
    Would it be possible with something like this [linux-speakup.org]? I've not played with either, so I don't know if this is a stupid question or not, just thought it was worth asking.
  • mplayer (Score:4, Informative)

    by dspeyer ( 531333 ) <dspeyer&wam,umd,edu> on Sunday December 26, 2004 @02:15AM (#11183721) Homepage Journal
    IIRC, mplayer can read realaudio format (using a free-as-in-beer binary x86/PPC/Alpha plugin [mplayerhq.hu]) and output WAV. If you tell it to use a named FIFO as its output file, you should be able to use it as a conversion filter in front of the broadcasting software with a minor (<1sec) time lag.

    For that matter, mplayer with FIFOs and a little CGI may make an adequate ad-hoc solution, though I suspect real-time MP3 encoding is a lot trickier, and a package designed for that might be a good idea.

  • by Anonymous Coward on Sunday December 26, 2004 @03:38AM (#11183858)
    To expand on that a bit, here's what I run on my server to convert the WMA feed from KQED (San Francisco public radio station) to a 30Kbps Ogg Vorbis stream I can listen to on my cellphone:

    vlc -I dummy http://www.kqed.org/w/streamingfiles/kqed_wmp.asx --sout '#transcode{acodec=vorb,ab=30}:standard{access=htt p,mux=ogg,url=my.server.com:8031/kqed.ogg}'

    Remove the space in front of the "p" if you're cutting and pasting that (Slashdot put it in there, not me.)

  • Re:Good suggestion (Score:2, Informative)

    by the angry liberal ( 825035 ) on Sunday December 26, 2004 @04:20AM (#11183929)
    One also has to ask why: Why is this tripe a headline?

    So, a user buys the wrong product, comes to slashdot and gets a headline. I have a better idea: hit Google and a couple of stream related forums for an hour or two. Figure it out. It is not very geek to bring such a basic question to a forum looking for turn-key solutions when you should have read the tech specs in the god damned advertisement before buying it..

    This is what happens when Bush voters get /. accounts.

"More software projects have gone awry for lack of calendar time than for all other causes combined." -- Fred Brooks, Jr., _The Mythical Man Month_

Working...