SpectrogramPlugin
Extends:
Implements:
Render a spectrogram visualisation of the audio.
Example:
// es6
import SpectrogramPlugin from 'wavesurfer.spectrogram.js';
// commonjs
var SpectrogramPlugin = require('wavesurfer.spectrogram.js');
// if you are using <script> tags
var SpectrogramPlugin = window.WaveSurfer.spectrogram;
// ... initialising wavesurfer with the plugin
var wavesurfer = WaveSurfer.create({
// wavesurfer options ...
plugins: [
SpectrogramPlugin.create({
// plugin options ...
})
]
});
Static Method Summary
Static Public Methods | ||
public static |
create(params: SpectrogramPluginParams): PluginDefinition Spectrogram plugin definition factory |
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
alpha: * |
|
public |
channels: * |
|
public |
colorMap: * |
|
public |
container: * |
|
public |
drawer: * |
|
public |
fftSamples: * |
|
public |
|
|
public |
frequencyMax: * |
|
public |
frequencyMin: * |
|
public |
height: * |
|
public |
noverlap: * |
|
public |
params: * |
|
public |
pixelRatio: * |
|
public |
spectrCc: * |
|
public |
|
|
public |
util: * |
|
public |
wavesurfer: * |
|
public |
width: * |
|
public |
windowFunc: * |
|
public |
wrapper: * |
Method Summary
Public Methods | ||
public |
|
|
public |
|
|
public |
destroy() |
|
public |
drawSpectrogram(frequenciesData: *, my: *) |
|
public |
freqType(freq: *): * |
|
public |
getFrequencies(callback: *) |
|
public |
init() |
|
public |
loadFrequenciesData(url: *): * |
|
public |
loadLabels(bgFill: *, fontSizeFreq: *, fontSizeUnit: *, fontType: *, textColorFreq: *, textColorUnit: *, textAlign: *, container: *) |
|
public |
render() |
|
public |
resample(oldMatrix: *): * |
|
public |
unitType(freq: *): * |
|
public |
|
|
public |
updateScroll(e: *) |
Inherited Summary
From class Observer | ||
public |
handlers: * |
|
public |
Manually fire an event |
|
public |
on(event: string, fn: function): ListenerDescriptor Attach a handler function for an event. |
|
public |
once(event: string, handler: function): ListenerDescriptor Attach a handler to an event. |
|
public |
setDisabledEventEmissions(eventNames: string[]) Disable firing a list of events by name. |
since 4.0.0 |
public |
Remove an event handler. |
|
public |
unAll() Remove all event handlers. |
Static Public Methods
public static create(params: SpectrogramPluginParams): PluginDefinition source
Spectrogram plugin definition factory
This function must be used to create a plugin definition which can be used by wavesurfer to correctly instantiate the plugin.
Params:
Name | Type | Attribute | Description |
params | SpectrogramPluginParams | Parameters used to initialise the plugin |
Public Constructors
Public Members
public alpha: * source
public channels: * source
public colorMap: * source
public container: * source
public drawer: * source
public fftSamples: * source
public frequenciesDataUrl: * source
public frequencyMax: * source
public frequencyMin: * source
public height: * source
public noverlap: * source
public params: * source
public pixelRatio: * source
public spectrCc: * source
public splitChannels: * source
public util: * source
public wavesurfer: * source
public width: * source
public windowFunc: * source
public wrapper: * source
Public Methods
public createCanvas() source
public createWrapper() source
public destroy() source
public drawSpectrogram(frequenciesData: *, my: *) source
Params:
Name | Type | Attribute | Description |
frequenciesData | * | ||
my | * |
public getFrequencies(callback: *) source
Params:
Name | Type | Attribute | Description |
callback | * |
public init() source
public loadLabels(bgFill: *, fontSizeFreq: *, fontSizeUnit: *, fontType: *, textColorFreq: *, textColorUnit: *, textAlign: *, container: *) source
Params:
Name | Type | Attribute | Description |
bgFill | * | ||
fontSizeFreq | * | ||
fontSizeUnit | * | ||
fontType | * | ||
textColorFreq | * | ||
textColorUnit | * | ||
textAlign | * | ||
container | * |
public render() source
public updateCanvasStyle() source
public updateScroll(e: *) source
Params:
Name | Type | Attribute | Description |
e | * |