简体   繁体   English

如何在Android中使用ffmpeg文件从URI播放音频文件

[英]How to play audio file from URI using ffmpeg files in android

HI all, 大家好,

I am working on playing audio from URI using ffmpeg shared library in android. 我正在使用android中的ffmpeg共享库从URI播放音频。

I configured android-ndk and added ffmpeg shared library to project and able to compile the project using cygwin. 我配置了android-ndk并向项目添加了ffmpeg共享库,并能够使用cygwin编译该项目。

In ffmpeg library i see ffmpeg.c file, i donot know how i can use this file to implement audio player in my activity. 在ffmpeg库中,我看到ffmpeg.c文件,我不知道如何在活动中使用此文件来实现音频播放器。

Please help me on this issue. 请帮我解决这个问题。

Thank you in advance 先感谢您

First, Use ffmpeg to open the URI and read frames and decode to raw PCM data, you can take a look at ffplay.c about the decoding part. 首先,使用ffmpeg打开URI并读取帧并解码为原始PCM数据,您可以在ffplay.c中查看有关解码部分的信息。

Next, using the Android AudioTrack class to play the raw PCM data, there is a tutorial: fun with audiotrack 接下来,使用Android AudioTrack类播放原始PCM数据,这里有一个教程: Audiotrack的乐趣

Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM