0

Possible Duplicate:
How to stream an .pls audio file in android 2.2

Can any body tell how to stream and play an .pls audio file using media player in android 2.2...

Community
  • 1
  • 1
HARIDASS
  • 33
  • 1
  • 6

2 Answers2

0

As far as I know .pls file contain information about songs or live radio stream. For exmaple when you use shoutcast api it returns .pls file which contain information related to list of radio stations like url of live radio stream, station name etc. Try opening it in notepad to see its format and information it contain. You have to parse url of song or station from it.

anujprashar
  • 6,263
  • 7
  • 52
  • 86
  • @anujprashar...his is the link i got...but not playing...http://www.wrestleview.com:8000/ can u tell me how to parse...it – HARIDASS Nov 25 '11 at 11:36
  • First download .pls file on your computer. Then open it in notepad to see its format. The .pls file will contain urls of live radio streams. You have to parse urls. Put content of file ihn a string object and use string methods to get urls. – anujprashar Nov 25 '11 at 11:42
  • @ anu when i opened in notepad its showing this link only...http://stream.radiosai.net:8002/ how to parse it ..plz post any example ....i am trying for three days.... – HARIDASS Nov 25 '11 at 11:45
  • See http://www.java2s.com/Open-Source/Android/App/mhyh-radio/com/giantrabbit/nagare/PlsFile.java.htm. It will give you an idea how to parse .pls file. In your case if that url was only content of .pls file then you dont have to parse anything as you have url of live radio stream. Play that url. – anujprashar Nov 25 '11 at 11:55
  • how to find that url content.. – HARIDASS Nov 25 '11 at 12:03
  • Paste content of your .pls file here. – anujprashar Nov 25 '11 at 12:07
  • ya ....that url only i am using in mediaplayer but then also not playing....any device problem....i am using android2.2 – HARIDASS Nov 25 '11 at 12:07
  • [playlist] NumberOfEntries=1 File1=http://stream.radiosai.net:8002/ this is the content.... – HARIDASS Nov 25 '11 at 12:09
  • Search for open source project 'Nagare' or NPR http://code.google.com/p/npr-android-app/source/browse/trunk/Npr/src/org/npr/android/news/StreamProxy.java if it is not playing. – anujprashar Nov 25 '11 at 12:13
0

First of all read the pls specification. You'll see it's quite straightforward. Just parse the pls file and extract the songs that you want to play.

fredley
  • 32,953
  • 42
  • 145
  • 236