arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Flutter Sound Helpers API

convertFile()

hashtag
convertFile()

  • Dart API: convertFile()arrow-up-right

This verb is useful to convert a sound file to a new format.

  • infile is the file path of the file you want to convert

  • codecin is the actual file format

  • outfile

Be careful : outfile and codecout must be compatible. The output file extension must be a correct file extension for the new format.

Note : this verb uses FFmpeg and is not available int the LITE flavor of Flutter Sound.

Example:

</div>

is the path of the file you want to create
  • codecout is the new file format

  • Dart
    Javascript
    
            String inputFile = '$myInputPath/bar.wav';
            var tempDir = await getTemporaryDirectory();
            String outpufFile = '${tempDir.path}/$foo.mp3';
            await flutterSoundHelper.convertFile(inputFile, codec.pcm16WAV, outputFile, Codec.mp3)
    
            Lorem ipsum ...