convertAudio method

  1. @override
Future<ConversionResult> convertAudio({
  1. required String inputPath,
  2. required String outputPath,
  3. required AudioFormat format,
  4. int bitRate = 128,
  5. int sampleRate = 44100,
  6. ProgressCallback? onProgress,
})
override

Converts an audio file to the specified format

Supports converting between various audio formats with customizable quality settings. Uses native platform APIs for optimal performance and compatibility.

inputPath - Path to the input audio file outputPath - Path where the converted file will be saved format - Target audio format (see AudioFormat) bitRate - Target bit rate in kbps (default: 128) sampleRate - Target sample rate in Hz (default: 44100) onProgress - Optional callback for conversion progress (0.0 to 1.0)

Returns ConversionResult with output file information. Throws AudioConversionException if conversion fails.

Implementation

@override
Future<ConversionResult> convertAudio({
  required String inputPath,
  required String outputPath,
  required AudioFormat format,
  int bitRate = 128,
  int sampleRate = 44100,
  ProgressCallback? onProgress,
}) async {
  throw UnsupportedError(
    'Audio conversion is not supported on web platform. '
    'Browser security and API limitations prevent direct audio format conversion. '
    'Consider using server-side conversion or native platforms for this feature.',
  );
}