[英]How to intergrate FFMPEG NDK library in android project to decode the audio files?
How to decode the audio files using FFMPEG NDK library? 如何使用FFMPEG NDK库解码音频文件? Below is the code i used to decode the mp3 file after merging two mp3 files.
下面是合并两个mp3文件后用于解码mp3文件的代码。 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());
}
I resolved this issue by regenerating a SO file. 我通过重新生成SO文件解决了此问题。 Then everything is working fine just by calling:
然后,只需调用以下命令,一切就可以正常工作:
process.exec("ffmpeg cmd");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.