saranya
saranya

Reputation: 228

How to intergrate FFMPEG NDK library in android project to decode the audio files?

How to decode the audio files using FFMPEG NDK library? Below is the code i used to decode the mp3 file after merging two mp3 files. try {

            String tempPath = Environment.getExternalStorageDirectory()+"/"+mvalue+".mp3";

            File fileTemp = new File(tempPath);

            ffmpeg = new FfmpegController(fileTemp,outFile);


            Clip clipMixOut = new Clip(outFile.getCanonicalPath());

            try {
                ffmpeg.convertToMPEG(clipMixOut,mCodecPath, new ShellUtils.ShellCallback() {

                    @Override
                    public void shellOut(String shellLine) {
                        // TODO Auto-generated method stub
                        System.out.println("fc>" + shellLine);

                    }

                    @Override
                    public void processComplete(int exitValue) {
                        // TODO Auto-generated method stub
                        System.err.println("concat non-zero exit: " + exitValue);

                    }
                });
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

        } catch (IOException e) {
            Log.e(TAG+":::", "IOException running ffmpeg" + e.getMessage());
        }

Upvotes: 0

Views: 250

Answers (1)

saranya
saranya

Reputation: 228

I resolved this issue by regenerating a SO file. Then everything is working fine just by calling:

process.exec("ffmpeg cmd");

Upvotes: 1

Related Questions