Android 2.2 MediaPlayer is working fine with one SHOUTcast URL but not with the other one

柔情痞子 提交于 2019-11-26 11:49:55

Shoutcast mp3 streaming from Android 2.2 onwards is supported natively .

Below 2.2 the Android OS cannot play shoutcast streams natively without using a proxy on the stream end or a stream proxy class on the device to capture the stream and pass it to the audioplayer just like NPR does.

audio/aacp streaming is not supported directly . For this you can use ffmpeg, opencore or faad2 library to decode it into PCM and play using audiotrack .Reference

problem is encoding in audio/aacp

Problem is that aacp is not rendered by Android Media Player properly. You will have to try some other codec or write your own decoder.

Mediaplayer supports only these formats as given in the android developer documents.

Some streams may be satisfying this,but some will not

There is a Freeware Advanced Audio (AAC) Decoder for Android. You can use this for help and Guidance or use Multiplayer class in it to playback aac audio. There is a sample app and library in it to help you understand. I have used this library to play Shoutcast online Streams. I played both AAC and MP3 using Multiplayer class provided in the library

Hope this helps

Finally, i got simple shoutcast streaming app. Try this. Just change streaming url in StreamService.java.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!