aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-09-24 18:45:33 -0400
committerbobzel <zzzman@gmail.com>2021-09-24 18:45:33 -0400
commitcbf22b4ccaab14a7c8cb62137ea09b58a001e13a (patch)
tree431f08d4ee721e6621a296e81cf8c20248dd66b6
parent1d808673353518a1e8ce0eaaf2d9fe14321a9210 (diff)
improved initial waveform display when making a clipping.
-rw-r--r--src/client/views/AudioWaveform.tsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/views/AudioWaveform.tsx b/src/client/views/AudioWaveform.tsx
index f7b117130..0a441552e 100644
--- a/src/client/views/AudioWaveform.tsx
+++ b/src/client/views/AudioWaveform.tsx
@@ -42,7 +42,8 @@ export class AudioWaveform extends React.Component<AudioWaveformProps> {
({ clipStart, clipEnd, fieldKey }) => {
if (!this.props.layoutDoc[fieldKey]) {
// setting these values here serves as a "lock" to prevent multiple attempts to create the waveform at nerly the same time.
- this.props.layoutDoc[fieldKey] = new List<number>(numberRange(AudioWaveform.NUMBER_OF_BUCKETS));
+ const waveform = Cast(this.props.layoutDoc[this.audioBucketField(0, this.props.rawDuration)], listSpec("number"), []);
+ this.props.layoutDoc[fieldKey] = new List<number>(waveform.slice(clipStart / this.props.rawDuration * waveform.length, clipEnd / this.props.rawDuration * waveform.length));
setTimeout(() => this.createWaveformBuckets(fieldKey, clipStart, clipEnd));
}
}, { fireImmediately: true });