• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps streaming audio (asx , m3u , pls)

JiMMaR

Android Enthusiast
Jun 12, 2010
362
57
I'm workin on an app that streams online radio (school project)
but the thing here is , the only format I managed to stream was an mp3 file.

is there a way to stream an asx file ?
I failed with pls and m3u as well :(

I used

Code:
MediaPlayer mp = new MediaPlayer();
        
        try {
            mp.setDataSource(PATH_TO_FILE);
            mp.prepare();
            mp.start();
        } catch (Exception e) {
            // TODO: handle exception
        }

but it just doesn't give me any errors or nothing..
 
Hiyer,

I also hit this dead-end when trying to build a streaming app.
Yes, MP3's do work, BUT trying to open and handle the m3u file to point it at the correct stream source has so far had me stumped.
I had almost forgotten about it until I read your post.

Perhaps we can either team up, or raise awareness on the other android programming forums as it does seem that either not many people have been able to do this, or this particular topic is not interesting enough... Im not too sure of which...

Anyhow, please leave this with me until monday (22nd November) and check back to see what I can find about dealing with these pesky m3u files.

Regards,
GIR
 
Upvote 0
I think it's because Android doesn't support these media formats as you can see on the link above:
Android Supported Media Formats | Android Developers

Regards

I agree!
Perhaps its time to pool resources (namely time and effort) and see if there's a class we can build to deal with this, after all many of the streaming apps on android market CAN handle m3u files, so why not us?

Im thinking it'll workout something like:

  • Open m3u file from url.
  • Read it as text and strip out comments to leave the URLS
  • maybe offer any URLS as a choice to be listened to
  • Play the stream

However, some tof the internet radio stations I'd like to listen to are Shoutcast, and there is a problem with the headers of these streams.
I very much doubt Shoutcast would change their set-up, so it'll be up to us to deal with this.

Perhaps someone has something to offer about saving and modifing the header from the stream into some which android finds more useable?

Let me know what you think folks...
Regards,
GIR
 
  • Like
Reactions: JiMMaR
Upvote 0
I didn't notice someone replied on this thread, and yeah I did search alot but couldn't find anything
but I think shoutcast is different , one of my classmates managed to stream from shoutcast on the iphone
the thing with shoutcast is that they actually use mp3 to stream, so by theory parsing the .pls file and getting the direct links to the mp3 stream should be possible

the problem is that most of other stations (mostly using asx) are using asf wma which is a microsoft format .. so that's a dead end for native playing
so unless you manage to figure out how to decode wma and play it ..

I'm in the middle of exams now [yes and I'm checking the forums :p] .. I'll give shoutcast streaming a shot and come back to you guys [that's if anyone is still interested in this]
 
Upvote 0
I'm very interested in this as well. I run a site that offers premium podcasting and live radio for authenticated users. I am building an android app for said site and would like to include live streaming functionality.

I use Shoutcast for my server so my stream would be something like http://www.wrestleview.com:8000/listen.pls. We stream in mp3 format.

Has anyone made any progress here?
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones