Search code examples
androidmedia-playerandroid-mediaplayeraudio-streaming

Radio stream issue


Hi we have an app in the playstore that has a module that play a stream from an url, the app works fine and we make a yearly release, but now that we are making changes, the part of the radio does not work, in any device.

Basically my code is

mediaPlayer = new MediaPlayer();
    try {
        mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
        mediaPlayer.setDataSource("http://radio.promosat.com:8104/");
        mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
            @Override
            public void onPrepared(MediaPlayer mp) {
                mp.start();
            }
        });
        mediaPlayer.prepareAsync();
    }catch (Exception ex){
        ex.printStackTrace();
    }

I keep getting this error E/MediaPlayer: Error (1,-2147483648)

This worked perfectly, the url that we use it's in the example code, it uses a pls file, that's where we obtained the stream url.


Solution

  • The error was the encoding of the stream...aacp is not supported in Android.