convertToWav method
Implementation
@override
Future<String> convertToWav(
String inputPath,
String outputPath, {
int? sampleRate,
int? channels,
int? bitDepth,
}) async {
try {
final args = <String, dynamic>{
'inputPath': inputPath,
'outputPath': outputPath,
};
if (sampleRate != null) args['sampleRate'] = sampleRate;
if (channels != null) args['channels'] = channels;
if (bitDepth != null) args['bitDepth'] = bitDepth;
final result = await methodChannel.invokeMethod<String>(
'convertToWav',
args,
);
if (result == null) {
throw AudioConversionException('Native conversion returned null');
}
return result;
} on PlatformException catch (e) {
throw AudioConversionException(
e.message ?? 'Unknown conversion error',
details: e.details?.toString(),
);
}
}