已经开始使用音频转换了吗?我使用了flutter_ffmpeg:包,但现在的官方包是ffmpeg_kit_flutter:但是libmp3lame库不工作,有人经历过这种情况吗?
Future _loadFileSalvar(nome,path) async {
String newPath = "";
var directory = await getExternalStorageDirectory();
List<String> paths = directory!.path.split("/");
for (int x = 1; x < paths.length; x++) {
String folder = paths[x];
newPath += "/" + folder;
}
newPath = newPath;
directory = Directory(newPath+"/$nome.mp3");
File file1 = File(directory.path);
String audioSampleFile = path;
String audioOutputFile = directory.path;
String ffmpegCommand = "ffmpeg -hide_banner -y -i $audioSampleFile -c:a libmp3lame -qscale:a 2 -ar 22050 $audioOutputFile";
FFmpegKit.executeAsync(ffmpegCommand, (session) async {
final returnCode = await session.getReturnCode();
print("returnCode $returnCode");
});
}
将不得不返回mp3从wav转换
1条答案
按热度按时间jv4diomz1#
试试这个:
1复制此代码:外部抖动FFmpeg Package = '完整'
2粘贴:./android/构建.gradle