1

for Streaming radio online code is below

   player = new MediaPlayer();
   player.setDataSource(RADIO_STATION_URL);
   player.setOnPreparedListener(new OnPreparedListener() {
        public void onPrepared(MediaPlayer mp) {
            player.start();
        }
    });

if i put url in place of RADIO_STATION_URL like http://test1.leanstream-hd.com/CFHKFM, it will give me an error

    02-18 17:12:34.035: E/MediaPlayer(1205): error (1, -2147483648)

and player is not working it will work on many url but in this case of url it is not working :(

I have googled and i got that some media format is not supported by mediaplayer by below link

http://developer.android.com/guide/appendix/media-formats.html

but can anybody suggest me how to find that Which url is containing which media format I want to make UNIVERSAL RADIO application in that link come from server which is dynamic

Harish
  • 3,122
  • 2
  • 31
  • 46
Siddhpura Amit
  • 14,534
  • 16
  • 91
  • 150

1 Answers1

2

Run the URI in the vlc and go to Tool --> Codec Information to check the detail.. Following are the screen shot for the http://test1.leanstream-hd.com/CFHKFM URI

enter image description here

enter image description here

Praful Bhatnagar
  • 7,425
  • 2
  • 36
  • 44
  • Thank you sooooo much :) Praful Bhatnagar – Siddhpura Amit Feb 18 '13 at 12:31
  • Can you try http://developer.android.com/reference/android/media/MediaPlayer.OnInfoListener.html and check for http://developer.android.com/reference/android/media/MediaPlayer.html#MEDIA_INFO_METADATA_UPDATE event,, – Praful Bhatnagar Feb 18 '13 at 12:42
  • Praful just last one if the file contain ACC file than have u solution or example for streaming that file? i have checked http://code.google.com/p/opencore-aacdec/ that library is used for streaming ACC file but i do not know how to use that library because it contain only .c and .h file i think NDK will be required but can u have an exmaple that uses this code than please tell me – Siddhpura Amit Feb 18 '13 at 12:47
  • you can read this http://developer.android.com/tools/sdk/ndk/index.html to uderstand how ndk works.. sorry I don't have the sample code.. also as per official doc found here http://developer.android.com/guide/appendix/media-formats.html it should be supported out of the box.. – Praful Bhatnagar Feb 18 '13 at 12:54