You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Spectrogram pluginimportWaveSurferfrom'wavesurfer.js'importSpectrogramfrom'wavesurfer.js/dist/plugins/spectrogram.esm.js'// Create an instance of WaveSurferconstws=WaveSurfer.create({container: '#waveform',waveColor: 'rgb(200, 0, 200)',progressColor: 'rgb(100, 0, 100)',url: '/examples/audio/audio.wav',sampleRate: 44100,minPxPerSec:100})// Initialize the Spectrogram pluginws.registerPlugin(Spectrogram.create({container: '#spectrogram',labels: true,height: 200,splitChannels: true,scale: 'mel',// or 'linear', 'logarithmic', 'bark', 'erb'frequencyMax: 8000,frequencyMin: 0,fftSamples: 1024,labelsBackground: 'rgba(0, 0, 0, 0.1)',}),)// Play on clickws.on('interaction',()=>{ws.playPause()})// Zoom on dblclickws.on('dblclick',()=>{ws.options.minPxPerSec*=2ws.zoom(ws.options.minPxPerSec)})/*<html> <div id="waveform"></div> <div id="spectrogram"></div> <p> 📖 <a href="https://wavesurfer.xyz/docs/modules/plugins_spectrogram">Spectrogram plugin docs</a> </p></html>*/
Expected result
Spec stays in sync with waveform
Obtained result
Waveform zooms, spec doesn't
Additional context
I'm not interested in the waveform, I would just like to render the spec. Currently (i.e. wavesurfer v6) I use display: none for the waveform div.
The workaround I have come up with for wavesurfer v7 is to have them use the same container, set both ws and spectrogram heights to 256, and apply the following css:
Minimal code snippet
Expected result
Spec stays in sync with waveform
Obtained result
Waveform zooms, spec doesn't
Additional context
I'm not interested in the waveform, I would just like to render the spec. Currently (i.e. wavesurfer v6) I use display: none for the waveform div.
The workaround I have come up with for wavesurfer v7 is to have them use the same container, set both ws and spectrogram heights to 256, and apply the following css:
The text was updated successfully, but these errors were encountered: