安卓:AAC +无线流不与MediaPlayer的工作(安卓4.2.2 / Shoucast链接) [英] Android: AAC+ radio streaming doesn't work with MediaPlayer (Android 4.2.2 / Shoucast links)

查看:167
本文介绍了安卓:AAC +无线流不与MediaPlayer的工作(安卓4.2.2 / Shoucast链接)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近面临着流AAC一些问题+ 与Android的广播流的MediaPlayer 关于到文档,应该有流AAC + Android中4.1的支持。 (测试设备是一台Nexus 2采用Android 4.2.2)

I'm recently faced with some problems of streaming AAC+ radio streams with the Android MediaPlayer. Regarding to the documentation, there should be support for streaming AAC+ in Android 4.1. (Test Device is a Nexus 2 with Android 4.2.2)

我发现了一些相关的问题(检查<一href="http://stackoverflow.com/questions/8166072/android-http-live-streaming-url-using-mediaplayer">here, <一href="http://stackoverflow.com/questions/8671479/android-mediaplayer-works-fine-in-custom-audio-streaming-application-up-to-andro/8833346#8833346">here或<一href="http://stackoverflow.com/questions/9850328/android-how-can-i-play-shoutcast-aac-aac-mp3-in-mediaplayer-for-android-2-3-a">here),但它们主要涉及到较老的Andr​​oid版本或者4.1的发布日之前,我发现 AACPlayerAndroid libary,但你必须购买许可证。

I found some related questions (check here, here or here), but they are mainly related to older Android versions or dated before the release of 4.1. I found the AACPlayerAndroid libary, but there you must purchase for a license..

如果我尝试流式传输的AACPlus流,在MediaPlayer抛出 MediaPlayerError(1,-2147483648),其定义为不支持的媒体格式。不过,如果我开始在仿真器相同的AAC +流,它工作正常!

If I try streaming an AACPlus Stream, the MediaPlayer throws MediaPlayerError (1,-2147483648), which is defined as "unsupported media format". However, if I start the same AAC+ Stream in Emulator, it is working fine!

我试过到目前为止:

  • 试图在模拟器作品相同的code?!? (whyever ..也许codeC支持在本地机器?)

  • trying same code in emulator works?!? (whyever.. maybe codec supported at local machine?)

测试两个其他设备上使用4.1或4.2失败以及

testing two other devices with 4.1 or 4.2 fails as well

设置AAC +流与手动头,以的setDataSource(字符串路径),它不能正常工作(改变HTTP头也没有)

set AAC+ stream with manual header and with setDataSource(String path), which doesn't work (changing http header also fails)

建立一个新的SimpleMediaPlayer项目 - >也失败了

set up a new SimpleMediaPlayer project -> fails too

尝试检查网络流量,如果Android设备将被重定向到一个错误的URL。其实我使用的是代理查尔斯连接的设备,但只能监控Android浏览器。不过我认为重定向是正确的!

trying to check network traffic, if android device is redirected to a wrong url. Actually I got the device connected with Charles using a Proxy, but was only able to monitor the Android Browser. Still I think that the redirect is correct!

下面是我实现我的Streaming.class

Here is my implementation of the setDataSource of my Streaming.class

public AmplifyMediaPlayer(PlayerStationObject playerStationObject, Context context) {
     super();
     this.setAudioStreamType(AudioManager.STREAM_MUSIC);
     this.mCurrentStationObject = playerStationObject;
     try {
        //AAC+ TestStream #1: NOT WORKING
        //Uri uri = Uri.parse("http://up-gc2.webnow.com.br/alpha.aac");

        //AAC+ TestStream #2: NOT WORKING   
        //Audio codec: 64 kbit/s 44.1 kHz AAC+, 128 kbit/s 44.1 kHz MP3
        //Uri uri = Uri.parse("http://relay.publicdomainproject.org:80/jazz_swing.aac   ");

        //Setting HTTP header for fixing some issues with normal setDataSource Header from Android
        //User-Agent "iTunes" was set to force re-direct to shoutcast streaming url     
        Map<String, String> headers = new HashMap<String, String>();
        headers.put("User-Agent", "iTunes");

        setDataSource(context, uri, headers);

        //AAC Codec works fine...
        //setDataSource("http://fri.net.pl:8000/fri");

        prepareAsync();

        //...

所以,其实我有以下几个问题:

So actually I'm having following questions:

为什么我不能在Android 4.1及更高版本发挥ACC +流,即使他们应该得到支持?

Why am I not able to play an ACC+ Stream on Android 4.1 and higher, even if they should be supported?

有没有人有一个ACC +流,这是他成功地与MediaPlayer的类Android电子流? (只是为了检查,如果有东西与我的球员集成)

Does anyone have an ACC+ Stream, which he successfully stream with the MediaPlayer Class from Android? (just to check, if there's be something with my player-integration)

如果ACC +不支持,你知道一个好的libary或示例项目看,他们是如何解决这个问题?

If ACC+ is not supported, do you know a good libary or an example project to look, how they solved the issue?

感谢或任何建议或意见!

Thanks or any suggestions or advices!

其他AAC +流,我测试: http://jam-aacp.rautemusik.fm

Other AAC+ Streams I tested: http://jam-aacp.rautemusik.fm

修改 到目前为止,我结束了:这是不可能的。该AACP德codeR库是一个很好的解决方案,但还不稳定。希望Android将很快支持。如果您不同意,请评论

EDIT So far, I ended up with: it's not possible. The AACP-Decoder Library is a good solution, but it is not stable yet. Hope Android will support this soon. If you disagree, PLEASE COMMENT!

推荐答案

我有我的应用程序相同的问题。

i had the same problem for my app.

我打了很多与MediaPlayer的,但没有成功。我甚至与应用程序内的一个代理,用于在较旧的Andr​​oid版本

I played alot with MediaPlayer with no success. I even tested with a proxy inside the app that is used for streaming MP3 Streams on older android versions

和我还测试了 aacplayer-机器人 /的 aacde codeR-机器人的,但它不是很稳定在我的测试...

and i also tested the aacplayer-android/aacdecoder-android, but it was not very stable in my tests...

我们结束了与 BASS为Android 的,因为我们无法找到。

We ended up with BASS for Android as we were unable to find.

不过,这还需要一个 AAC专利许可如果你想*该应用程序的公共(供私人使用,我认为它不关心...)也它需要一个 BASS许可证除非你是一个非商业实体。

But it also requires an AAC Patent License* if you want to make the app public (for private use i think it does not care...) also it requires an BASS License unless you are a non-commercial entity.

*)Android应用算的消费品的不一样的消费PC软件的...只是为了避免我们取得了我们的应用程序...

*) Android Apps count as Consumer Products not as Consumer PC Software... just to avoid the mistake we made for our app...

[更新]
为什么需要专利费?
一要尽快支付费用的产品(在这种情况下,应用程序)带来的是自己去codeR(或EN codeR)既,BASS和aacde codeR-的Andr​​oid带来thier自己去codeR code,它们需要有一个AAC许可证。只有当它有可能使用德codeR可用在主机系统上(即许可/由主机SYSTE的显影剂支付 - 在这种情况下,谷歌)它是免费。但因为它似乎目前还没有办法ACC​​ES /使用设备codeCS ...

[UPDATE]
Why are the patent fees required?
One have to pay fees as soon as the Product(in this case the App) brings is own decoder (or encoder) as both, BASS and aacdecoder-android bring thier own decoder code, they required to have an AAC license. Only if it would be possible to use the decoder available on the host system(that is licensed/paid by the developer of the host syste - in this case Google) it is "free". But as it seemsthere is currently no way to acces/use the device codecs...

这篇关于安卓:AAC +无线流不与MediaPlayer的工作(安卓4.2.2 / Shoucast链接)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆