createSpectrogram
createSpectrogram(
canvas,audioBuffer,options?):Promise<any>
Defined in: packages/pleco-xa/src/scripts/SpectrumAnalyzer.js:536
Creates a spectrogram visualization of audio over time
Parameters
Section titled “Parameters”canvas
Section titled “canvas”HTMLCanvasElement
Target canvas element
audioBuffer
Section titled “audioBuffer”AudioBuffer
Audio buffer to analyze
options?
Section titled “options?”any = {}
Spectrogram options
Returns
Section titled “Returns”Promise<any>
Spectrogram data and metadata
Example
Section titled “Example”import { createSpectrogram } from './SpectrumAnalyzer.js';
const spectrogram = await createSpectrogram(canvas, audioBuffer, { fftSize: 2048, hopLength: 512, colormap: 'hot'});