praveenb
praveenb

Reputation: 10669

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.

I configured android-ndk and added ffmpeg shared library to project and able to compile the project using 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.

Please help me on this issue.

Thank you in advance

Upvotes: 2

Views: 2796

Answers (1)

Bolton
Bolton

Reputation: 2256

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.

Next, using the Android AudioTrack class to play the raw PCM data, there is a tutorial: fun with audiotrack

Good luck!

Upvotes: 1

Related Questions