sonic_lite.c
static void downSampleInput(short *samples) {
  int numSamples = 2 * SONIC_MAX_PERIOD / SONIC_SKIP;
  int i, j;
  int value;
  short *downSamples = sonicStream.downSampleBuffer;

  for (i = 0; i < numSamples; i++) {
    value = 0;
    for (j = 0; j < SONIC_SKIP; j++) {
      value += *samples++;
    }
    value /= SONIC_SKIP;
    *downSamples++ = value;
  }
}
/* If skip is greater than one, average skip samples together and write them to
   the down-sample buffer. */
If skip is greater than one, average skip samples together and write them to
the down-sample buffer.
If skip is greater than one average skip samples together and write them to the down - sample buffer .
static void downSampleInput(short *samples) {
  int numSamples = 2 * SONIC_MAX_PERIOD / SONIC_SKIP;
  int i, j;
  int value;
  short *downSamples = sonicStream.downSampleBuffer;
  for (i = 0; i < numSamples; i++) {
    value = 0;
    for (j = 0; j < SONIC_SKIP; j++) {
      value += *samples++;
    }
    value /= SONIC_SKIP;
    *downSamples++ = value;
  }
}
static void downSampleInput ( short * samples ) { int numSamples = 2 * SONIC_MAX_PERIOD / SONIC_SKIP ; int i , j ; int value ; short * downSamples = sonicStream . downSampleBuffer ; for ( i = 0 ; i < numSamples ; i ++ ) { value = 0 ; for ( j = 0 ; j < SONIC_SKIP ; j ++ ) { value += * samples ++ ; } value /= SONIC_SKIP ; * downSamples ++ = value ; } }
If skip is greater than one, average skip samples together and write them to
the down-sample buffer.
If skip is greater than one average skip samples together and write them to the down - sample buffer .