Clarify comment

This commit is contained in:
Travis Ralston 2021-03-30 12:01:35 -06:00
parent 54412878a1
commit 60326e359a

View file

@ -140,7 +140,9 @@ export class VoiceRecorder {
// and will instead return a Float32Array still.
const translatedData: number[] = [];
for (let i = 0; i < data.length; i++) {
// We're clamping the values so we can do that math operation mentioned above.
// We're clamping the values so we can do that math operation mentioned above,
// and to ensure that we produce consistent data (it's possible for the array
// to exceed the specified range with some audio input devices).
translatedData.push(percentageOf(data[i], 0, 1));
}