How to play .pls files/streams

All your problems with Audio, Video and Images.

How to play .pls files/streams

Postby Coyle » Sat Nov 28, 2009 10:47 am

Hey,
I'm trying to listen to .pls live streams but I can't find a way to get it working. Since StreamFurious and DroidLive can do it there must be away to do so. I really hope someone can point me to the right direction.

Rgds
coyle
Coyle
Freshman
Freshman
 
Posts: 8
Joined: Sun Aug 30, 2009 9:08 am

Top

Postby Darwin » Mon Nov 30, 2009 9:01 am

This is exactly what I've been looking at doing, so I'll be monitoring this topic for pointers as well.

I didn't get as much time as I would have liked this weekend to test out some methods, but I was considering having a downloader thread that's constantly grabbing data from the stream and writing them to small, ordered files. I'd have another thread cleaning up files that have already been played, and finally I'd have one or two media players reading the files.

I'm not sure how I'd get the downloader part of it working, as I haven't really mucked around with pulling data from HTTP on Android yet, but it shouldn't be too bad. I just need to make sure that the data pulled from the .pls source is readable by the mediaplayer.

I'll keep an eye on here, and I'll let you know if I can find out more on this. Any advice from others would be greatly appreciated.
Darwin
Freshman
Freshman
 
Posts: 2
Joined: Mon Nov 30, 2009 8:56 am

Postby Coyle » Thu Dec 03, 2009 4:05 pm

Sounds promising I'm looking forward to it ^^. I'll make some researches as well.

Edit:
I'll try to connect via tcp to the stream (socket) and listen for incoming data. This might be a fist attempt.
Coyle
Freshman
Freshman
 
Posts: 8
Joined: Sun Aug 30, 2009 9:08 am

Postby Coyle » Sat Dec 26, 2009 8:29 pm

Just to push this topic up again...

I finally found a very good sample:
http://github.com/Dawnthorn/nagare/

With this sample I managed to get a shoutcast running the only problem I have is that there are short interruptions after a few seconds. Hope you could check it out and help me with fixing that.

Rgds
Coyle
Coyle
Freshman
Freshman
 
Posts: 8
Joined: Sun Aug 30, 2009 9:08 am

Postby willis127 » Thu Dec 31, 2009 8:30 am

using the same open source project (nagare). Tried creating a second mediaplayer to start before I stopped the original mediaplayer and still a gap. Albeit a wee bit smaller but still noticable gap

**Edit**

Finally got Nagare working better. I set up the buffer() to use 2 mediaplayers and I used the ShoutcastFile to check how much of the mp3 was left
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. NagareService.m_media_player.getDuration() - NagareService.m_media_player.getCurrentPosition() <= 1000
  3.  
  4.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


if that rang true it called NagareService.m_run_buffer.run();

then in buffer I used 2 mediaplayers to hand off to each other and the one ending would wait 525ms java.lang.Object.class.wait(525);
before stopping the mediaplayer.

Very crude way of knocking it out but i couldnt figure out a different way
and this way streaming mp3's are now gapless for my purpose.

**Edit Again

The gap between players increases the longer the media plays using this method because it takes longer and longer for the mediaplayers to seekTo the current location. One way around this would be to create two files for buffering and hand off back and forth, keeping both files under 250kb should keep the gap pretty small and predictable. Or everytime it conducts a handoff it could start the new mediaplayer with the new file and start from the beginning. Some data may be lost using this method.

I'm just brainstorming.
willis127
Freshman
Freshman
 
Posts: 9
Joined: Wed Nov 11, 2009 8:03 pm

Postby Coyle » Sat Jan 02, 2010 12:26 pm

Would you be so kind and post your buffer and download methode where you check how much of the mp3 is left?

I'd appreciate it :D

Rgds
Coyle
Coyle
Freshman
Freshman
 
Posts: 8
Joined: Sun Aug 30, 2009 9:08 am

Top

Postby willis127 » Tue Jan 05, 2010 2:42 am

Coyle wrote:Would you be so kind and post your buffer and download methode where you check how much of the mp3 is left?

I'd appreciate it :D

Rgds
Coyle


sure
But I dont use Nagare Anymore because it was pretty buggy. And I dont need to support anything other then streaming mp3.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.  
  3.  
  4. if(mediaplayer.getDuration() - mediaplayer.getCurrentPosition() <= 1000){
  5.  
  6. //TO DO execute next buffered file
  7.  
  8. }
  9.  
  10.  
  11.  
  12.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
willis127
Freshman
Freshman
 
Posts: 9
Joined: Wed Nov 11, 2009 8:03 pm

Postby K20 » Fri Jan 29, 2010 5:01 pm

I am very interested about your method if you have a solution about this little bug in move of buffers ;)
K20
Freshman
Freshman
 
Posts: 5
Joined: Wed Jul 22, 2009 8:03 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 12 guests