renderMono method

void renderMono(
  1. List<double> destination, {
  2. int offset = 0,
})
Renders the waveform as a monaural signal. The audio renderer. The destination buffer.

Implementation

void renderMono(List<double> destination, {int offset = 0})
{
    int sampleCount = destination.length ~/ 2;

    sampleCount -= offset;

    List<double> left = List<double>.filled(sampleCount, 0);
    List<double> right = List<double>.filled(sampleCount, 0);

    render(left, right);

    for (var t = 0; t < sampleCount; t++)
    {
        destination[offset + t] = (left[t] + right[t]) / 2;
    }
}