arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Flutter Sound Helpers API

pcmToWave()

hashtag
pcmToWave()

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

This verb is usefull to convert a Raw PCM file to a Wave file.

It adds a Wave envelop to the PCM file, so that the file can be played back with startPlayer().

Note: the parameters numChannels and sampleRate are mandatory, and must match the actual PCM data. a discussion about Raw PCM and WAVE file format.

Example:

</div>


        String inputFile = '$myInputPath/bar.pcm';
        var tempDir = await getTemporaryDirectory();
        String outpufFile = '${tempDir.path}/$foo.wav';
        await flutterSoundHelper.pcmToWave(inputFile: inputFile, outpoutFile: outputFile, numChannels: 1, sampleRate: 8000);
See herearrow-up-right
Dart
Javascript

        Lorem ipsum ...