intToSample function

double intToSample(
  1. int x,
  2. int bits
)

Converts an int x of bit width bits to an audio sample in the range -1, 1.

Implementation

double intToSample(int x, int bits) => (x / _readScale(bits)) - 1;