|
|
@ -36,7 +36,7 @@ public class FFmpegUtil { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@SuppressLint("DefaultLocale") |
|
|
|
@SuppressLint("DefaultLocale") |
|
|
|
public static String[] cutAudio(String srcFile, int startTime, int duration, String targetFile){ |
|
|
|
public static String[] cutAudio(String srcFile, int startTime, int duration, String targetFile){ |
|
|
|
String cutAudioCmd = "ffmpeg -i %s -ss %d -t %d %s"; |
|
|
|
String cutAudioCmd = "ffmpeg -i %s -acodec copy -ss %d -t %d %s"; |
|
|
|
cutAudioCmd = String.format(cutAudioCmd, srcFile, startTime, duration, targetFile); |
|
|
|
cutAudioCmd = String.format(cutAudioCmd, srcFile, startTime, duration, targetFile); |
|
|
|
return cutAudioCmd.split(" ");//以空格分割为字符串数组
|
|
|
|
return cutAudioCmd.split(" ");//以空格分割为字符串数组
|
|
|
|
} |
|
|
|
} |
|
|
|