From 79aa205a95e49fb2171b18dadf36fe1ec7b190fe Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 12 Jul 2021 14:05:59 -0600 Subject: [PATCH] variablize --- src/voice/Playback.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/voice/Playback.ts b/src/voice/Playback.ts index 10e4ad6b7d..9f46530de4 100644 --- a/src/voice/Playback.ts +++ b/src/voice/Playback.ts @@ -31,6 +31,7 @@ export enum PlaybackState { } export const PLAYBACK_WAVEFORM_SAMPLES = 39; +const THUMBNAIL_WAVEFORM_SAMPLES = 100; // arbitrary: [30,120] const DEFAULT_WAVEFORM = arraySeed(0, PLAYBACK_WAVEFORM_SAMPLES); function makePlaybackWaveform(input: number[]): number[] { @@ -73,7 +74,7 @@ export class Playback extends EventEmitter implements IDestroyable { this.fileSize = this.buf.byteLength; this.context = createAudioContext(); this.resampledWaveform = arrayFastResample(seedWaveform ?? DEFAULT_WAVEFORM, PLAYBACK_WAVEFORM_SAMPLES); - this.thumbnailWaveform = arrayFastResample(seedWaveform ?? DEFAULT_WAVEFORM, 100); + this.thumbnailWaveform = arrayFastResample(seedWaveform ?? DEFAULT_WAVEFORM, THUMBNAIL_WAVEFORM_SAMPLES); this.waveformObservable.update(this.resampledWaveform); this.clock = new PlaybackClock(this.context); }