Important facts about commercial licenses

  • Licenses are perpetual. They do not expire and do not need to be renewed.
  • Licenses can be upgraded. You can upgrade to a more expensive license later paying only the difference in cost.
  • Pay attention to the distribution type - Hosted (sites / servers), binary (applications) or source (includes all the others). Choose according to your needs (more below).
  • All licenses allow commercial use unless otherwise indicated.
  • Read the full license by clicking on the icon.
  • Read more about licenses in our handy license guide.
$249

Single App License

1 application Binary restricted distribution 6 months support
$749

Developer License

5 applications Binary restricted distribution 6 months support
$1,999

Distributor License

Unlimited projects Source and binary distribution 1 year support
You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

(2 ratings)

RadioTunes SDK for Appcelerator

RadioTunes SDK for Appcelerator
Developed by Kemal Taskin, Released Jul 30, 2012

This is the Appcelerator port of the successful RadioTunes SDK component. Using this component you can write powerful radio apps in Javascript and access all the features of RadioTunes SDK.

JavaScript

Tags: appcelerator , ffmpeg , ios , ipad

RadioTunes Codec Support

A Powerful Radio Streaming Framework for Appcelerator App Developers!

This is a port of the 5-star rated RadioTunes SDK for iOS component which was originally developed for the iOS platform. Now you can use this powerful radio streaming engine in your Appcelerator apps too and start writing radio apps in Javascript!

Behind the scenes RadioTunes relies on the iOS AudioQueue framework and the open source LGPL licensed FFmpeg library. If your app does not require mms/wma codec functionality you can also use the RadioTunes SDK without including the FFmpeg library. The code for mms streaming is completely separated from the code for http streaming so that you can choose which portions of code you want to include in your project.

Disclaimer: RadioTunes SDK can play all Window Media Audio version 9 streams but some streams based on version 10 could fail. This Appcelerator module will only work on iOS devices and does not support Android!

Make your App look like a Pro

Be sure to check out the Radiojive Template if you want a great looking design for your radio app. This template also includes a fully working radio app that uses RadioTunes SDK!

Download the FREE Trial now and see for yourself how simple it is to add radio playback functionality to your app!

Back to top

Features

  • NEW FEATURE IN VERSION 2.1!
    • ASX playlist support.
  • NEW FEATURES IN VERSION 2.0!
    • Realtime audio recording.
    • Improved audio session management.
    • Bandwidth usage statistics.
  • Support for the http and mms protocols.
  • Supports mp3, aac, aac+ and wma audio streams.
  • PLS, M3U, ASX, XSPF and direct URL support.
  • Parsing of Shoutcast/Icecast metadata.
  • Automatic handling of interruptions like incoming phone calls.
  • Background play on iOS 4.
  • Robust error handling.
  • Auto reconnect feature.
  • Works on Edge/3G/WiFi.
Back to top

How to Use

To access this module from JavaScript, you would do the following:

var radiotunes = require("yl.radiotunes");

The radiotunes variable now holds a reference to the Module object.

Events

The radiotunes module fires 3 events to nofity you about audio session interruptions. You should handle these events like this:

radiotunes.addEventListener('begin_interruption', function(e) {
    if(myapp.radio === null) {
        return;
    }

    myapp.radio.pause();
});

radiotunes.addEventListener('end_interruption', function(e) {
    if(myapp.radio === null) {
        return;
    }

    if(myapp.radio.isPaused()) {
        myapp.radio.play();
    }
});

radiotunes.addEventListener('headphone_unplugged', function(e) {
    if(myapp.radio === null) {
        return;
    }

    // Pause radio if it's playing while headphones are unplugged
    if(myapp.radio.isPlaying()) {
        myapp.radio.pause();
    }
});

If you want to respond to the audio control buttons on the iPhone lock screen you should handle the following events:

radiotunes.addEventListener('remote_control_toggle_play_pause', function(e) {
    if(myapp.radio == null) {
        return;
    }

    if(myapp.radio.isPaused()) {
        myapp.radio.play();
    } else {
        myapp.radio.pause();
    }
});

radiotunes.addEventListener('remote_control_next_track', function(e) {
    // Add code to play next radio station here.
});

radiotunes.addEventListener('remote_control_previous_track', function(e) {
    // Add code to play previous radio station here.
});

radiotunes.createHTTPRadio

Use this function to create a Radio object for http streaming.

var radio = radiotunes.createHTTPRadio("http://some-host.com/radio")

radiotunes.createMMSRadio

Use this function to create a Radio object for mms streaming.

var radio = radiotunes.createMMSRadio("http://some-host.com/radio")

Radio Methods

  • play() - Start streaming.
  • pause() - Pause streaming.
  • startRecordingWithDestination(String path) - Start recording to the specified file path.
  • stopRecording() - Stop recording.
  • fileExtensionHint() - Returns the appropriate filename extension that should be used for recording.
  • shutdown() - This method should be called before disposing the radio object!
  • isPlaying() - Returns the value of the boolean playing property.
  • isPaused() - Returns the value of the boolean paused property.
  • isBuffering() - Returns the value of the boolean buffering property.
  • isRecording() - Returns the value of the boolean recording property.
  • setBufferInSeconds(Number seconds) - Sets the number of seconds to buffer before playback starts.
  • setVolume(Number volume) - Sets the volume. This value should be between 0 and 1.

Bandwidth Methods

The connection type parameter passed as argument to some of the functions must have one of the following values:

0 = All connection types
1 = WWAN connection type
2 = WiFi connection type
  • bandwidthUsageForConnectionType(Number type) - Reports the bandwidth usage for the specified network connection type.
  • resetBandwidth() - Resets the bandwidth usage for all network connection types.
  • resetBandwidthForConnectionType(Number type) - Resets the bandwidth usage for the specified network connection type.

Radio Events

metadata - Fired when the Shoutcast/Icecast metadata for the radio is parsed and ready.

myapp.radio.addEventListener('metadata', function(e) {
    if(e.name !== undefined) {
        Ti.API.info("Radio name: " + e.name);
    }
    if(e.genre !== undefined) {
        Ti.API.info("Radio genre: " + e.genre);
    }
    if(e.url !== undefined) {
        Ti.API.info("Radio url: " + e.url);
    }
});

title - Fired when the current playing item title is changed.

myapp.radio.addEventListener('title', function(e) {
    myapp.ui.titleLabel.setText("Now playing: " + e.title);
});

state - Fired when the state of the radio object is changed.

myapp.radio.addEventListener('state', function(e) {
    var state = e.state;
    if(state == 0) {
        myapp.ui.statusLabel.setText("Status: Stopped");
    } else if(state == 1) {
        myapp.ui.statusLabel.setText("Status: Connecting");
    } else if(state == 2) {
        myapp.ui.statusLabel.setText("Status: Buffering");
    } else if(state == 3) {
        myapp.ui.statusLabel.setText("Status: Playing");
    } else if(state == 4) {
        myapp.ui.statusLabel.setText("Status: Error");

        var error = e.error;
        if(error == 1) {
            myapp.ui.titleLabel.setText("Playlist could not be parsed.");
        } else if(error == 2) {
            myapp.ui.titleLabel.setText("File stream get property failed.");
        } else if(error == 3) {
            myapp.ui.titleLabel.setText("File stream could not be opened.");
        } else if(error == 4) {
            myapp.ui.titleLabel.setText("Audio queue could not be created.");
        } else if(error == 5) {
            myapp.ui.titleLabel.setText("Audio buffers could not be created.");
        } else if(error == 6) {
            myapp.ui.titleLabel.setText("Audio queue enqueue failed.");
        } else if(error == 7) {
            myapp.ui.titleLabel.setText("Audio queue could not be started.");
        } else if(error == 8) {
            myapp.ui.titleLabel.setText("Audio decoding error.");
        } else if(error == 9) {
            myapp.ui.titleLabel.setText("Radio host not reachable.");
        } else if(error == 10) {
            myapp.ui.titleLabel.setText("Network connection error.");
        }
    }
});

recording_started - Fired when recording has started.

myapp.radio.addEventListener('recording_started', function(e) {
    Ti.API.info("Recording started to path: " + e.path);
});

recording_stopped - Fired when recording has stopped successfully.

myapp.radio.addEventListener('recording_stopped', function(e) {
    Ti.API.info("Recording available at path: " + e.path);
});

recording_failed - Fired when recording has failed.

myapp.radio.addEventListener('recording_failed', function(e) {
    Ti.API.info("Recording failed: " + e.description);
    var code = e.code;
    if(code == 0) {
        Ti.API.info("Recording failed: initialisation error");
    } else if(error == 1) {
        Ti.API.info("Recording failed: file error");
    } else if(error == 2) {
        Ti.API.info("Recording failed: format error");
    } else if(error == 3) {
        Ti.API.info("Recording failed: write error");
    }
    myapp.ui.main.recButton.setImage('record_off.png');
});
Back to top

Package

  • Complete source code of the RadioTunes SDK.
  • Complete source code of the Appcelerator module.
  • Detailed documentation with integration instructions.
  • Demo Javascript app.
  • Fully automated build scripts for FFmpeg that will build universal static libraries for the armv6, armv7 and i386 architectures.
  • Pre-built FFmpeg universal static libraries with support for the mms protocol and wma audio codec.
View all 2 reviews »

User Reviews

  • Marius 7 months ago
    Good communication, very responsive about updates, great module!
    Flag
    Was this helpful? Yes No
  • Achraf Bouyakhsass 8 months ago
    It works perfectly without any problem.
    Flag
    Was this helpful? Yes No
Read all 10 comments »

Questions & Comments


Or enter your name and Email
  • Digital Frontiers Media License holderSingle App License 6 months ago
    Hello,

    First off, thank you for sharing such great tools. Second, I apologize in advance for the long-winded question ahead but we're kind of desperate for some rather technical help/answers.

    We've been having issues with a client's SHOUTcast stream not playing on our Appcelerator iOS app ONLY on AT&T 3G network connections (works fine on Verizon 3G networks, Wi-Fi, etc.). This issue just suddenly "happened" one day in June 2012 for thousands of listeners in the Las Vegas region without us having pushed any sort of update or anything. We thought this was caused by some sort of throttling or provisioning change by AT&T on their 3G network at that time. However, the same stream seems to be accessible via the TuneIn Radio app. So it appears to be a combination of the built-in Appcelerator Titanium.Media.AudioPlayer object/methods, AT&T's 3G Network, and the client's SHOUTcast stream ( http://208.43.207.221:80/;listen.pls ). In the event that this SDK somehow circumvents this issue, we would push to immediately purchase and implement it within the app. Is there any way someone could test this SDK against the above stream on an iOS device using an AT&T 3G network connection so we could verify if we should pursue this SDK as an option?

    Thank you,
    Stephen
    • Kemal Taskin Developer 6 months ago
      Hi Stephen,

      The iOS version has a demo that you can try before purchasing the Appcelerator module: http://bit.ly/RadioTunesDemo. Both projects use the same code base so this should give you an idea wether the code works or not.
    • Digital Frontiers Media License holderSingle App License 6 months ago
      Perfect. Thank you! Will check it out!
  • Marius License holderSingle App License 7 months ago
    Hello, can you update the module to have the same characteristics as the module for ios 1.17?
    thank you
    • Kemal Taskin Developer 7 months ago
      Hi Marius,

      I'll try to release an update today.
    • Marius License holderSingle App License 7 months ago
      Thank Kemal and the suggestion about the control buttons you can add the same time?
    • Kemal Taskin Developer 7 months ago
      Ok, I'll do that.
    • Marius License holderSingle App License 7 months ago
      great
  • Marius License holderSingle App License 9 months ago
    Hello, during the installation I get this error


    [ERROR] clang: error: linker command failed with exit code 1 (use -v to see invocation)
    [ERROR]
    [ERROR] Error: Traceback (most recent call last):
    File "/Library/Application Support/Titanium/mobilesdk/osx/2.0.1.GA2/iphone/builder.py", line 1318, in main
    execute_xcode("iphonesimulator%s" % link_version,["GCC_PREPROCESSOR_DEFINITIONS=__LOG__ID__=%s DEPLOYTYPE=development TI_DEVELOPMENT=1 DEBUG=1 TI_VERSION=%s %s %s" % (log_id,sdk_version,debugstr,kroll_coverage)],False)
    File "/Library/Application Support/Titanium/mobilesdk/osx/2.0.1.GA2/iphone/builder.py", line 1224, in execute_xcode
    output = run.run(args,False,False,o)
    File "/Library/Application Support/Titanium/mobilesdk/osx/2.0.1.GA2/iphone/run.py", line 41, in run
    sys.exit(rc)
    SystemExit: 65
You must be logged-in to vote. Log-in to your account or register now.