The easiest way to play an audio RTMP stream in Android

后端 未结 2 1341
长发绾君心
长发绾君心 2020-12-02 11:43

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.

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-02 12:21

    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.

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

提交回复
热议问题