sonic_lite.c
static void processStreamInput(void) {
  int originalNumOutputSamples = sonicStream.numOutputSamples;
  float speed = sonicStream.speed;

  if (speed > 1.00001) {
    changeSpeed(speed);
  } else {
    copyToOutput(sonicStream.inputBuffer, sonicStream.numInputSamples);
    sonicStream.numInputSamples = 0;
  }
  if (sonicStream.volume != 1.0f) {
    /* Adjust output volume. */
    scaleSamples( sonicStream.outputBuffer + originalNumOutputSamples,
        (sonicStream.numOutputSamples - originalNumOutputSamples), sonicStream.volume);
  }
}
/* Resample as many pitch periods as we have buffered on the input.  Also scale
   the output by the volume. */
Resample as many pitch periods as we have buffered on the input.  Also scale
the output by the volume.
Resample as many pitch periods as we have buffered on the input . Also scale the output by the volume .
static void processStreamInput(void) {
  int originalNumOutputSamples = sonicStream.numOutputSamples;
  float speed = sonicStream.speed;
  if (speed > 1.00001) {
    changeSpeed(speed);
  } else {
    copyToOutput(sonicStream.inputBuffer, sonicStream.numInputSamples);
    sonicStream.numInputSamples = 0;
  }
  if (sonicStream.volume != 1.0f) {
    scaleSamples( sonicStream.outputBuffer + originalNumOutputSamples,
        (sonicStream.numOutputSamples - originalNumOutputSamples), sonicStream.volume);
  }
}
static void processStreamInput ( void ) { int originalNumOutputSamples = sonicStream . numOutputSamples ; float speed = sonicStream . speed ; if ( speed > 1.00001 ) { changeSpeed ( speed ) ; } else { copyToOutput ( sonicStream . inputBuffer , sonicStream . numInputSamples ) ; sonicStream . numInputSamples = 0 ; } if ( sonicStream . volume != 1.0f ) { scaleSamples ( sonicStream . outputBuffer + originalNumOutputSamples , ( sonicStream . numOutputSamples - originalNumOutputSamples ) , sonicStream . volume ) ; } }
Resample as many pitch periods as we have buffered on the input.
Resample as many pitch periods as we have buffered on the input .
/* Adjust output volume. */