在Android的播放音频RTMP流的最简单方法最简单、音频、方法、Android

2023-09-12 07:04:11 作者:Grind(折磨)

我发现了一些Android的RTMP库。(是这样的: http://rtmpdump.mplayerhq.hu/ )

I found some Android RTMP libraries (like this : http://rtmpdump.mplayerhq.hu/).

现在的问题是,有关于我们如何使用它没有准确的文档。

The problem is that there is no accurate documentation on how we can use it.

在我的情况,我有一个简单的RTMP现场音频流(例如:RTMP:// MYSERVER / MyApp的/ myliveaudio)。

In my case, I have a simple RTMP live audio stream (ex: rtmp://myserver/myapp/myliveaudio).

什么是看它在我的Andr​​oid应用程序的最简单的方法是什么?

What is the easiest way to read it in my Android app?

请,我不想链接:我需要几张code或一些精确的一步一步的解释

Please, I don't want links: I need some pieces of code or some accurate step-by-step explanation.

非常感谢你。

推荐答案

这是不幸的是不平凡难以做到的。现在最好的办法是看code在http://$c$c.google.com/p/android-rtmp-client/:具体看http://$c$c.google.com/p/android-rtmp-client/source/browse/trunk/example/com/ryong21/example/recorder/RecorderClient.java和http://$c$c.google.com/p/android-rtmp-client/source/browse/trunk/example/com/ryong21/example/recorder/Recorder.java.通过采取在一个流的MP3文件,并记录其内容为FLV文件在磁盘上的这些行走。

It is unfortunately non-trivially difficult to do. Right now your best bet is to look at the code in http://code.google.com/p/android-rtmp-client/: specifically look at http://code.google.com/p/android-rtmp-client/source/browse/trunk/example/com/ryong21/example/recorder/RecorderClient.java and http://code.google.com/p/android-rtmp-client/source/browse/trunk/example/com/ryong21/example/recorder/Recorder.java. These walk through taking in a streamed MP3 file and recording its contents to an FLV file on disk.

您需要修改RecorderClient.java文件(特别是围绕线193)播放音频数据了扬声器。

You would need to modify the RecorderClient.java file (specifically around line 193) to play the audio data out the speakers.