资源说明:xz -d ***.tar.xz
tar -xvf ***.tar
public static boolean amrToMp3(String localPath, String targetFilePath,String fileUrl) {
try {
System.out.println("************** ffmpeg ****************");
java.lang.Runtime rt = Runtime.getRuntime();
//命令
String command = fileUrl+"ffmpeg -i " + localPath + " " + targetFilePath;
//执行amr转MP3命令
Process proc = rt.exec(command);
InputStream stderr = proc.getErrorStream();
InputStreamReader isr = new InputStreamReader(stderr);
BufferedReader br = new BufferedReader(isr);
String line = null;
StringBuffer sb = new StringBuffer();
while ((line = br.readLine()) != null)
sb.append(line);
System.out.println("ffmpeg Process errorInfo: " + sb.toString());
int exitVal = proc.waitFor();
System.out.println("ffmpeg Process exitValue: " + exitVal);
return true;
} catch (Exception e) {
System.out.println("ffmpeg exec cmd Exception " + e.toString());
}
return false;
}
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。