Adds a simple spectrogram to your wavesurfer.js instances.
WaveSurfer
instanceWaveSurfer
's "ready"
event callback
var wavesurfer = WaveSurfer.create({
// your options here
plugins: [
WaveSurfer.spectrogram.create{
wavesurfer: wavesurfer,
container: "#wave-spectrogram"
})
]
});
wavesurfer.load('example/media/demo.wav');
wavesurfer
- required - a WaveSurfer instance.container
- required - the element in which to place the spectrogram, or a CSS selector to find it.fftSamples
- number of FFT samples (512
by default). Number of spectral lines and height of the spectrogram will be a half of this parameter.frequenciesDataUrl
- URL to load spectral data from.