convert method
Convert audio file from OGG to AAC.
inputPath
is the absolute path to the input OGG file.
outputPath
is the desired absolute path for the output AAC file.
Returns the absolute path to the converted AAC file if successful. Throws PlatformException if the conversion process fails.
Implementation
@override
Future<String?> convert(String inputPath, String outputPath) async {
if (inputPath.isEmpty || outputPath.isEmpty) {
throw ArgumentError('Input and output paths cannot be empty.');
}
try {
final String? resultPath = await methodChannel.invokeMethod('convertOggToAac', {
'inputPath': inputPath,
'outputPath': outputPath,
});
return resultPath;
} catch (e) {
// Error during conversion process
rethrow;
}
}