Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Live Radio streaming

I am posting this question third time but still no one give me clue what should I do to run live streaming radio aacp file, here my code

var url = "http://demo.icy.ast.com/na-live-64";
var streamer = Ti.Media.createAudioPlayer();
streamer.url = url;
Can anyone tell me about its solution? I have spent 2 days in it and still stuck in this problem.

— asked October 6th 2010 by utpal kishen
  • aacp_file
  • iphone
  • live_radio
  • radio
  • streaming

3 Answers

  • Accepted Answer

    Utpal - I posted a similar question some time ago. It seems that the AudioPlayer API does not support AAC, only mp3. Many people have never even heard of AAC which is a real shame as my radio station (Radio Caroline) also wants to stream an existing AAC stream and is stuck with mp3.

    — answered October 26th 2010 by Patrick Mounteney
    • is AAC supported now?

      — commented July 29th 2011 by vincent youmans
    • As I'm back here again (accidentally) and saw that I'd responded before I'll just say that the way people stream AAC using Appcelerator nowadays is by using the video player. This works in iOS (where you can make an instance of the video player but not add it to a view) but not tried it on Android.

      — commented August 29th 2013 by Patrick Mounteney
  • The host seems down. The following functions works for me in a streaming app and has some usefule events. NOTE: the reusable "sound" var in this example is declared outside of this function.

    function loadAudio(s){    
      sound = Ti.Media.createAudioPlayer({url:s,preload:true,allowBackground:true});
        sound.addEventListener('error', function(e){
        if(e.message == "Unknown media error"){
                 // detect your specific error code here
        sound.addEventListener('complete', function(){ 
            // your skip code here
        sound.addEventListener('interrupted', function(){
                // your code here
        sound.addEventListener('resume', function(){
             // your code here
        sound.addEventListener('progress', function(e){
             // your code here

    Maybe try using a simple mp3 hosted on your own as source to verify your code is good. You can implement a timeout using the progress event to detect network errors or null reponses.

    Hope this helps,


    — answered October 6th 2010 by Mike Zeena
  • Yes Patrick, you are right . I used mp3 server and my streaming run perfectly. but it won't allow aacp file to start. Thank You.

    — answered October 26th 2010 by utpal kishen
    1 Comment
    • when you say mp3 server, do you mean a public FTP site with the mp3's or is it s private ftp, or is it some other kind of streaming system… I am talking about the HOST for the mobile app… I am actually looking for some success stories.

      — commented July 29th 2011 by vincent youmans
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.