
The RadioStreams SDK is a radio streaming component for Android developers which simplifies the application development process while creating a radio/audio streaming app. Can be integrated easily.
Features
Disclaimer: RadioStreams SDK can play all WMA version 9 streams but most version 10 streams not supported.
Disclaimer #2: Use of this software may require the payment of patent royalties.
Creating MMSRadio or HTTPRadio object
HTTPRadio radio = new HTTPRadio(new URI("http://mfm.ice.infomaniak.ch/playlists/mfm-64.aac.m3u"));
radio.play();
MMSRadio radio = new MMSRadio(new URI("mms://wstream5a.di.fm/vocaltrance"));
radio.play();
Handling radio state and metadata changes
radio.setRadioChangeListener(new RadioChangeListener() {
public void radioStateChanged(final RadioState state) {
runOnUiThread(new Runnable() {
public void run() {
switch (state) {
case RADIO_STATE_BUFFERING:
status.setText("Status: Buffering");
break;
case RADIO_STATE_CONNECTING:
status.setText("Status: Connecting");
break;
case RADIO_STATE_PLAYING:
status.setText("Status: Playing");
break;
case RADIO_STATE_STOPPED:
status.setText("Status: Stopped");
break;
case RADIO_STATE_ERROR:
switch (radio.getRadioError()) {
case RADIO_ERROR_PLAYLIST_PARSING:
status.setText("Status: Playlist Parsing Error");
break;
case RADIO_ERROR_DECODING:
status.setText("Status: Decoding Error");
break;
case RADIO_ERROR_NETWORK_ERROR:
status.setText("Status: Network Error");
break;
case RADIO_ERROR_FILE_STREAM_OPEN:
status.setText("Status: Stream Open Error");
break;
default:
status.setText("Status: Error");
}
break;
}
}
});
}
public void radioMetadataChanged(final IcyMetadata metadata) {
runOnUiThread(new Runnable() {
public void run() {
nowPlaying.setText("Now Playing: " + metadata.radioTitle);
}
});
}
});
Copy dist/* to root directory of your Android application.
Move dist/libs to root directory of your Android application.
In Eclipse right click to your project folder and select Refresh
In Package Explorer right click on RadioStreamsSDK.jar and select Build Path - Add to Build Path
Go to the ffmpeg-scripts folder and edit settings.sh and update NDK_BASE variable with your android-ndk path. Than just run
./compile
You may also need to update your PATH if ./compile fails.
export PATH=/Users/USERNAME/android-ndk-r8b/prebuilt/darwin-x86/bin:/Users/USERNAME/android-ndk-r8b/:$PATH
After running ./compile script succesfully, ffmpeg static libraries will be generated under ffmpeg-scripts/ffmpeg. Copy those libraries into jni folder:
cp ffmpeg-scripts/ffmpeg/libavcodec/libavcodec.a jni/
cp ffmpeg-scripts/ffmpeg/libavformat/libavformat.a jni/
cp ffmpeg-scripts/ffmpeg/libavutil/libavutil.a jni/
Than to build libradiostreams.so get back to root folder and run
ndk-build -B V=1
Overall it's great that someone is working on this kind of component but still a lot of work to go to make it fully useable. We were unable to actually use it because it lacked some core important features. I hope the developer stays active and makes the necessary fixes.
From our developers:
"Currently we are not using Radio Sdk due to issues with some core functionality necessary for this app. There is no function to pause the stream once started. The pause function acts as stop function. Also there is no support for streaming audio in a background service. I tried integrating it but outcome was not satisfactory. I have added a suggestion comments in binpress.com for the SDK, if developer fixes these issues then we can integrate it."
It is very difficult to integrate if you don't know android NDK.
Questions & Comments