1. Download our Official Android App: Forums for Android!

Apps streaming audio (asx , m3u , pls)

Discussion in 'Android Development' started by JiMMaR, Nov 13, 2010.

  1. JiMMaR

    JiMMaR Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    363
    Joined:
    Jun 12, 2010

    Jun 12, 2010
    363
    57
    53
    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
    Rank:
    None
    Points:
    18
    Posts:
    96
    Joined:
    Feb 14, 2010

    Feb 14, 2010
    96
    10
    18
    Classified.
    UK
    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 Newbie
    Rank:
    None
    Points:
    16
    Posts:
    27
    Joined:
    Apr 7, 2010

    Apr 7, 2010
    27
    1
    16
    Programmer (Coordinator)
    Brazil
  4. GIR

    GIR Well-Known Member
    Rank:
    None
    Points:
    18
    Posts:
    96
    Joined:
    Feb 14, 2010

    Feb 14, 2010
    96
    10
    18
    Classified.
    UK
    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 Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    53
    Posts:
    363
    Joined:
    Jun 12, 2010

    Jun 12, 2010
    363
    57
    53
    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 Lurker
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Jan 15, 2011

    Jan 15, 2011
    2
    0
    5
    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?
    Rank:
    None
    Points:
    513
    Posts:
    7,973
    Joined:
    Nov 29, 2009

    Nov 29, 2009
    7,973
    3,603
    513
    Android App Developer
    NY
    JiMMaR likes this.

Share This Page

Loading...