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