2

I searched for information before posting and I didn't find exactly what I was looking for. Hopefully someone can point me in the right direction. There is a certain radio show that I like to listen to, but I can't listen to it all the time because it broadcasts during the middle of the day. I would like to have the capability to record parts of it on the days that I can't listen. Does Java provide the means to record audio from an internet radio stream? I'm willing to use another language if Java isn't the right choice for this. I'm just not quite sure where to start.

Thanks alot

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Codebug
  • 801
  • 2
  • 8
  • 6

1 Answers1

2

You can use LiveHttpHeaders Firefox addon to dump the HTTP headers to find which URL is streamed. (You will see the ressource file).

Then, no need of Java for this, a simple curl command should do the trick :

curl -A "Mozilla/5.0" -b /tmp/c -c /tmp/c "http://domain.tld/path/to/radio_show.extension" > radio_show.flv

Edit : with the real URL :

curl -A "Mozilla/5.0" -L -b /tmp/c -c /tmp/c -s "http://208.92.55.56/WABCAMAAC?streamtheworld_user=1&nobuf=1337218977154" > /tmp/dump
Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223
  • @sputnik Thanks for the response. However, I'm running windows and if I'm not mistaken, I don't think I have access to curl. I thought curl was a linux/unix thing. Also, I forgot to mention that I would like to have the recording start at a certain time. That way the stream can record on its own while I am away. – Codebug May 17 '12 at 00:50
  • Doh ! =) cURL is OS agnostic, see http://curl.haxx.se/download.html See http://stackoverflow.com/questions/2710748/run-curl-commands-from-windows-console too – Gilles Quénot May 17 '12 at 00:54
  • @sputnik I downloaded LiveHttpHeaders and looked through the http headers. I didn't see an explicit file extension denoting the type of stream. I.e. the URL for the stream didn't have a file extension on the end of it. However, at the bottom of the HTTP response, there is a line that says : Content-Type: application/flv. Does that confirm that it is an flv stream? – Codebug May 17 '12 at 01:22
  • Yes, this is the "mime-type". Can you show us the LiveHttpHeaders or simply the URL ? – Gilles Quénot May 17 '12 at 01:26
  • @sputnik Sure, here is the URL: http://player.streamtheworld.com/_players/citadel/?sid=826&nid=2920 – Codebug May 17 '12 at 01:34
  • @sputnik Thanks alot for the info. A quick question, could you explain the command? What are the paths for, i.e. /tmp/c and /tmp/dump? – Codebug May 17 '12 at 01:57