Chirag Kothiya
Chirag Kothiya

Reputation: 1099

flutter package for trim audio

I am trying to create a flutter app with trim audio. For that, I am looking for a library to trim a audio like video_trimmer.

I have tried the audiocutter package. But the package is old and it's use flutter_ffmpeg package.

But In my app used ffmpeg_kit_flutter package for video trimming. So I can't use audiocutter package.

Thanks in Advance

Upvotes: 0

Views: 757

Answers (1)

Flutter Developer
Flutter Developer

Reputation: 26

You can use following FFmpegKit command to cut audio.

double start = 1;
double end = 5;

var cmd = "-y -i \"$path\" -vn -ss $start -to $end -ar 16k -ac 2 -b:a 96k -acodec copy $outPath";

FFmpegKit.executeAsync(cmd, (session) async {
    
    final returnCode = await session.getReturnCode();
    print("returnCode $returnCode");

});

Upvotes: 1

Related Questions