Search code examples
flutteraudiosample

Flutter - Sampling of an Audio File


Is it possible to split an audio file into individual samples in Flutter? Does anyone know a suitable way?


Solution

  • Yes, you can use this simple plugin to import, cut and then export new audio files https://pub.dev/packages/audiocutter

    and then u can use this code:

    import 'package:audiocutter/audiocutter.dart';
    
    
    var start = 15.0;
    var end = 25.5;
    
    // Set The Path to You Your File To Import
    var path = 'path/to/audio/file.mp3';
    
    // Get path to cut file and do whatever you want with it.
    var outputFilePath = await AudioCutter.cutAudio(path, start, end);