Skip to content

Commit

Permalink
Handling multi channel peaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Mounir Abid committed Nov 3, 2023
1 parent b85454d commit c310889
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/plugins/minimap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,18 @@ class MinimapPlugin extends BasePlugin<MinimapPluginEvents, MinimapPluginOptions
const media = this.wavesurfer.getMediaElement()
if (!data || !media) return

const peaks = [];
for (let i = 0; i < data.numberOfChannels; i++) {
peaks.push(data.getChannelData(i));
}

this.miniWavesurfer = WaveSurfer.create({
...this.options,
container: this.minimapWrapper,
minPxPerSec: 0,
fillParent: true,
media,
peaks: [data.getChannelData(0)],
peaks,
duration: data.duration,
})

Expand Down

0 comments on commit c310889

Please sign in to comment.