pcmToWaveBuffer()

Flutter Sound Helpers API


pcmToWaveBuffer()

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

It adds a Wave envelop in front of the PCM buffer, so that the file can be played back with startPlayerFromBuffer().

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

Example:

        Uint8List myWavBuffer = await flutterSoundHelper.pcmToWaveBuffer(inputBuffer: myPCMBuffer, numChannels: 1, sampleRate: 8000);
        Lorem ipsum ...