code: function truncateSamples(samples) {
    /** @type {number} */   
    let len = samples.length;
    for (let i=0; i<len; i++) {
      if (samples[i] > 1) {
        samples[i] = 1;
      } else if (samples[i] < -1) {
        samples[i] = -1;
      }
    }
  }
docs: Truncate float samples on over and underflow.
  @private