Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 7f56ec7

Browse files
committed
docs
1 parent 0806af0 commit 7f56ec7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/voice/Playback.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ export class Playback extends EventEmitter implements IDestroyable {
9393
public async prepare() {
9494
this.audioBuf = await this.context.decodeAudioData(this.buf);
9595

96+
// Update the waveform to the real waveform once we have channel data to use. We don't
97+
// exactly trust the user-provided waveform to be accurate...
9698
const waveform = Array.from(this.audioBuf.getChannelData(0)).map(v => clamp(v, 0, 1));
9799
this.resampledWaveform = arrayFastResample(waveform, PLAYBACK_WAVEFORM_SAMPLES);
98100
this.waveformObservable.update(this.resampledWaveform);

0 commit comments

Comments
 (0)