trimAudio method
Implementation
@override
Future<String> trimAudio(String inputPath, String outputPath, Duration start, Duration end) async {
try {
final result = await methodChannel.invokeMethod<String>(
'trimAudio',
{
'inputPath': inputPath,
'outputPath': outputPath,
'startMs': start.inMilliseconds,
'endMs': end.inMilliseconds,
},
);
if (result == null) {
throw AudioConversionException('Native trimAudio returned null');
}
return result;
} on PlatformException catch (e) {
throw AudioConversionException(
e.message ?? 'Unknown error',
details: e.details?.toString(),
);
}
}