streaming audio (asx , m3u , pls)


Last Updated:

  1. JiMMaR

    JiMMaR Well-Known Member This Topic's Starter

    Joined:
    Jun 12, 2010
    Messages:
    363
    Likes Received:
    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 (Text):
    1.  
    2. MediaPlayer mp = new MediaPlayer();
    3.        
    4.         try {
    5.             mp.setDataSource(PATH_TO_FILE);
    6.             mp.prepare();
    7.             mp.start();
    8.         } catch (Exception e) {
    9.             // TODO: handle exception
    10.         }
    11.  
    but it just doesn't give me any errors or nothing..
     

    Advertisement
  2. GIR

    GIR Well-Known Member

    Joined:
    Feb 14, 2010
    Messages:
    96
    Likes Received:
    10
    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
     
  3. fabiocberg

    fabiocberg Active Member

    Joined:
    Apr 7, 2010
    Messages:
    27
    Likes Received:
    1
  4. GIR

    GIR Well-Known Member

    Joined:
    Feb 14, 2010
    Messages:
    96
    Likes Received:
    10
    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
     
    JiMMaR likes this.
  5. JiMMaR

    JiMMaR Well-Known Member This Topic's Starter

    Joined:
    Jun 12, 2010
    Messages:
    363
    Likes Received:
    57
    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]
     
  6. tvanstone

    tvanstone New Member

    Joined:
    Jan 15, 2011
    Messages:
    2
    Likes Received:
    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?
     
  7. alostpacket

    alostpacket Over Macho Grande? VIP Member

    Joined:
    Nov 29, 2009
    Messages:
    7,978
    Likes Received:
    3,603
    JiMMaR likes this.

Share This Page

Loading...