android 软件包ffmpeg_kit_flutter:^5.1.0没有libmp3lame

zbdgwd5y  于 2022-12-09  发布在  Android
关注(0)|答案(1)|浏览(169)

已经开始使用音频转换了吗?我使用了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转换

jv4diomz

jv4diomz1#

试试这个:

1复制此代码:外部抖动FFmpeg Package = '完整'

2粘贴:./android/构建.gradle

相关问题