Flutter - 音频文件的采样

Flutter - Sampling of an Audio File

是否可以在 Flutter 中将音频文件拆分为单独的样本?有谁知道合适的方法吗?

是的,您可以使用这个简单的插件来导入、剪切然后导出新的音频文件 https://pub.dev/packages/audiocutter

然后你可以使用这个代码:

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);