Skip to content

Commit 3904b7b

Browse files
authored
fix: FIT-250: SplitChannel audio with spectrogram displaying blank space on waveform (#7820) (#7824)
Co-authored-by: bmartel <[email protected]>
1 parent d5a0cfc commit 3904b7b

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

web/libs/editor/src/lib/AudioUltra/Visual/Renderer/WaveformRenderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class WaveformRenderer implements Renderer<WaveformRendererConfig> {
105105
renderWave(context: RenderContext, channelNumber: number, layer: Layer, iStart: number, iEnd: number): boolean {
106106
const renderId = this.config.renderId;
107107
const audio = this.audio;
108-
const height = this.config.waveHeight / (audio?.channelCount ?? 1);
108+
const height = this.config.waveHeight;
109109
const scrollLeftPx = context.scrollLeftPx;
110110
const zoom = context.zoom;
111111
const amp = this.config.amp ?? 1;
@@ -139,7 +139,7 @@ export class WaveformRenderer implements Renderer<WaveformRendererConfig> {
139139
let x = 0;
140140
const audio = this.audio;
141141
const channelCount = audio?.channelCount ?? 1;
142-
const height = this.config.waveHeight / channelCount;
142+
const height = this.config.waveHeight;
143143
const scrollLeftPx = context.scrollLeftPx;
144144
const dataLength = context.dataLength;
145145
this.lastWaveformRenderedScrollLeftPx = scrollLeftPx;

web/libs/editor/src/lib/AudioUltra/Visual/Visualizer.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export class Visualizer extends Events<VisualizerEvents> {
154154
backgroundLayer,
155155
config: {
156156
renderId: this.renderId,
157-
waveHeight: this.waveHeight,
157+
waveHeight: this.waveformHeight,
158158
padding: this.padding,
159159
reservedSpace: this.reservedSpace,
160160
waveColor: this.waveColor,
@@ -1092,14 +1092,13 @@ export class Visualizer extends Events<VisualizerEvents> {
10921092
if (!spectrogramLayer?.isVisible) return 0;
10931093

10941094
const channelCount = this.audio?.channelCount ?? 1;
1095-
const totalAvailableHeight = this.waveHeight;
10961095

10971096
if (this.splitChannels) {
10981097
// Each channel gets an equal split of the spectrogram area
1099-
return totalAvailableHeight / channelCount;
1098+
return this.waveHeight / channelCount;
11001099
}
11011100
// Spectrogram uses the full height when not split
1102-
return totalAvailableHeight;
1101+
return this.waveHeight;
11031102
}
11041103

11051104
setAmp(amp: number) {

0 commit comments

Comments
 (0)