2014-06-12 18 views
0

如何使用FFMPEG NDK庫解碼音頻文件? 以下是合併兩個mp3文件後用於解碼mp3文件的代碼。 嘗試{如何整合Android項目中的FFMPEG NDK庫來解碼音頻文件?

  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()); 
     } 

回答

1

我通過重新生成SO文件解決了此問題。然後一切正常,只需撥打電話:

process.exec("ffmpeg cmd"); 
相關問題