Typedef
Static Public Summary | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
The parameters used to describe a marker. |
|
public |
|
|
public |
|
|
public |
|
|
public |
Extends the |
|
public |
|
|
public |
The Object used to describe a plugin |
|
public |
The parameters used to describe a region. |
|
public |
|
since 4.0.0 This class has been split |
public |
|
|
public |
parameters applied when splitChannels option is true |
since 4.3.0 |
public |
Extends the |
|
public |
|
Static Public
public CursorPluginParams: Object source
Properties:
Name | Type | Attribute | Description |
deferInit | boolean |
|
Set to true to stop auto init in |
hideOnBlur | boolean |
|
Hide the cursor when the mouse leaves the waveform |
width | string |
|
The width of the cursor |
color | string |
|
The color of the cursor |
opacity | number | string |
|
The opacity of the cursor |
style | string |
|
The border style of the cursor |
zIndex | number |
|
The z-index of the cursor element |
customStyle | object | An object with custom styles which are applied to the cursor element |
|
showTime | boolean |
|
Show the time on the cursor. |
customShowTimeStyle | object | An object with custom styles which are applied to the cursor time element. |
|
followCursorY | boolean |
|
Use |
formatTimeCallback | function | Formats the timestamp on the cursor. |
|
isDestroyCalled | boolean | true if called destroy before the ready event fired |
public ElanPluginParams: Object source
Properties:
Name | Type | Attribute | Description |
container | string | HTMLElement | CSS selector or HTML element where the ELAN information should be rendered. |
|
url | string | The location of ELAN XML data |
|
deferInit | boolean |
|
Set to true to manually call |
tiers | Object |
|
If set only shows the data tiers with the |
public InitParams: Object source
Properties:
Name | Type | Attribute | Description |
defaults | WavesurferParams |
|
The default wavesurfer initialisation parameters |
containers | string | NodeList |
|
Selector or NodeList of elements to attach instances to |
pluginCdnTemplate | string |
|
URL template for the dynamic loading of plugins |
loadPlugin | function | If set overwrites the default request function, can be used to inject plugins differently. |
public MarkerParams: Object source
The parameters used to describe a marker.
Properties:
Name | Type | Attribute | Description |
time | number | The time to set the marker at |
|
string | label |
|
An optional marker label |
string | tooltip |
|
An optional marker tooltip |
string | color |
|
Background color for marker |
string | position |
|
"top" or "bottom", defaults to "bottom" |
element | markerElement |
|
An HTML element to display instead of the default marker image |
boolean | draggable |
|
Set marker as draggable, defaults to false |
preventContextMenu | boolean |
|
Determines whether the context menu is prevented from being opened, defaults to false |
Example:
wavesurfer.addMarker(regionParams);
public MarkersPluginParams: Object source
Properties:
Name | Type | Attribute | Description |
markers | MarkerParams[] |
|
Initial set of markers |
public MediaSessionPluginParams: Object source
Properties:
Name | Type | Attribute | Description |
metadata | MediaMetadata | A MediaMetadata object: a representation of the metadata associated with a MediaSession that can be used by user agents to provide a customized user interface. |
|
deferInit | boolean |
|
Set to true to manually call
|
public MicrophonePluginParams: Object source
Properties:
Name | Type | Attribute | Description |
constraints | MediaStreamConstraints | The constraints parameter is a MediaStreamConstaints object with two members: video and audio, describing the media types requested. Either or both must be specified. |
|
bufferSize | number |
|
The buffer size in units of sample-frames.
If specified, the bufferSize must be one of the following values: |
numberOfInputChannels | number |
|
Integer specifying the number of channels for this node's input. Values of up to 32 are supported. |
numberOfOutputChannels | number |
|
Integer specifying the number of channels for this node's output. |
deferInit | boolean |
|
Set to true to manually call
|
public MinimapPluginParams: Object source
Extends the WavesurferParams
wavesurfer was initialised with
Properties:
Name | Type | Attribute | Description |
container | string | HTMLElement |
|
CSS selector or HTML element where the map should be rendered. By default it is simply appended after the waveform. |
deferInit | boolean |
|
Set to true to manually call
|
public PlayheadPluginParams: Object source
Properties:
Name | Type | Attribute | Description |
draw | boolean |
|
Draw the playhead as a triangle/line |
moveOnSeek | boolean |
|
Seeking (via clicking) while playing moves the playhead |
returnOnPause | boolean |
|
Pausing the track returns the seek position to the playhead |
public PluginDefinition: Object source
The Object used to describe a plugin
Properties:
Name | Type | Attribute | Description |
name | string | The name of the plugin, the plugin instance will be added as a property to the wavesurfer instance under this name |
|
staticProps | Object |
|
The properties that should be added to the wavesurfer instance as static properties |
deferInit | boolean |
|
Don't initialise plugin automatically |
params | Object |
|
The plugin parameters, they are the first parameter passed to the plugin class constructor function |
instance | PluginClass | The plugin instance factory, is called with the dependency specified in extends. Returns the plugin class. |
Example:
wavesurfer.addPlugin(pluginDefinition);
public RegionParams: Object source
The parameters used to describe a region.
Properties:
Name | Type | Attribute | Description |
id | string |
|
The id of the region |
start | number |
|
The start position of the region (in seconds). |
end | number |
|
The end position of the region (in seconds). |
loop | boolean |
|
Whether to loop the region when played back. |
drag | boolean |
|
Allow/disallow dragging the region. |
resize | boolean |
|
Allow/disallow resizing the region. |
color | string |
|
HTML color code. |
channelIdx | number |
|
Select channel to draw the region on (if there are multiple channel waveforms). |
handleStyle | object |
|
A set of CSS properties used to style the left and right handle. |
preventContextMenu | boolean |
|
Determines whether the context menu is prevented from being opened. |
showTooltip | boolean |
|
Enable/disable tooltip displaying start and end times when hovering over region. |
Example:
wavesurfer.addRegion(regionParams);
public RegionsPluginParams: Object since 4.0.0 This class has been split source
Properties:
Name | Type | Attribute | Description |
dragSelection | boolean |
|
Enable creating regions by dragging with the mouse |
regions | RegionParams[] |
|
Regions that should be added upon initialisation |
slop | number |
|
The sensitivity of the mouse dragging |
snapToGridInterval | number |
|
Snap the regions to a grid of the specified multiples in seconds |
snapToGridOffset | number |
|
Shift the snap-to-grid by the specified seconds. May also be negative. |
deferInit | boolean |
|
Set to true to manually call |
maxRegions | number | Maximum number of regions that may be created by the user at one time.
|
|
formatTimeCallback | function | Allows custom formating for region tooltip. |
|
edgeScrollWidth | number |
|
from container edges' Optional width for edgeScroll to start |
public SpectrogramPluginParams: Object source
Properties:
Name | Type | Attribute | Description |
container | string | HTMLElement | Selector of element or element in which to render |
|
fftSamples | number |
|
Number of samples to fetch to FFT. Must be a power of 2. |
splitChannels | boolean |
|
Render with separate spectrograms for the channels of the audio |
height | number |
|
Height of the spectrogram view in CSS pixels |
labels | boolean | Set to true to display frequency labels. |
|
noverlap | number | Size of the overlapping window. Must be < fftSamples. Auto deduced from canvas size by default. |
|
windowFunc | string |
|
The window function to be used. One of
these: |
alpha | number |
|
Some window functions have this extra value. (Between 0 and 1) |
pixelRatio | number |
|
to control the size of the spectrogram in relation with its canvas. 1 = Draw on the whole canvas. 2 = Draw on a quarter (1/2 the length and 1/2 the width) |
frequencyMin | number |
|
Min frequency to scale spectrogram. |
frequencyMax | number |
|
Max frequency to scale spectrogram. Set this to samplerate/2 to draw whole range of spectrogram. |
deferInit | boolean |
|
Set to true to manually call
|
colorMap | number[][] |
|
A 256 long array of 4-element arrays. Each entry should contain a float between 0 and 1 and specify r, g, b, and alpha. |
public SplitChannelOptions: Object since 4.3.0 source
parameters applied when splitChannels option is true
Properties:
Name | Type | Attribute | Description |
overlay | boolean |
|
determines whether channels are rendered on top of each other or on separate tracks |
channelColors | object |
|
object describing color for each channel. Example: { 0: { progressColor: 'green', waveColor: 'pink' }, 1: { progressColor: 'orange', waveColor: 'purple' } } |
filterChannels | number[] |
|
indexes of channels to be hidden from rendering |
relativeNormalization | boolean |
|
determines whether normalization is done per channel or maintains proportionality between channels. Only applied when normalize and splitChannels are both true. |
splitDragSelection | boolean |
|
determines if drag selection in regions plugin works separately on each channel or only one selection for all channels |
public TimelinePluginParams: Object source
Extends the WavesurferParams
wavesurfer was initialised with
Properties:
Name | Type | Attribute | Description |
container | string | HTMLElement |
|
CSS selector or HTML element where the timeline should be drawn. This is the only required parameter. |
notchPercentHeight | number |
|
Height of notches in percent |
unlabeledNotchColor | string |
|
The colour of the notches that do not have labels |
primaryColor | string |
|
The colour of the main notches |
secondaryColor | string |
|
The colour of the secondary notches |
primaryFontColor | string |
|
The colour of the labels next to the main notches |
secondaryFontColor | string |
|
The colour of the labels next to the secondary notches |
labelPadding | number |
|
The padding between the label and the notch |
zoomDebounce | number |
|
A debounce timeout to increase rendering performance for large files |
fontFamily | string |
|
|
fontSize | number |
|
Font size of labels in pixels |
duration | number |
|
Length of the track in seconds. Overrides getDuration() for setting length of timeline |
formatTimeCallback | function | (sec, pxPerSec) -> label |
|
timeInterval | function | (pxPerSec) -> seconds between notches |
|
primaryLabelInterval | function | (pxPerSec) -> cadence between labels in primary color |
|
secondaryLabelInterval | function | (pxPerSec) -> cadence between labels in secondary color |
|
offset | number |
|
Offset for the timeline start in seconds. May also be negative. |
deferInit | boolean |
|
Set to true to manually call
|
public WavesurferParams: Object source
Properties:
Name | Type | Attribute | Description |
audioContext | AudioContext |
|
Use your own previously initialized AudioContext or leave blank. |
audioRate | number |
|
Speed at which to play audio. Lower number is slower. |
audioScriptProcessor | ScriptProcessorNode |
|
Use your own previously initialized ScriptProcessorNode or leave blank. |
autoCenter | boolean |
|
If a scrollbar is present, center the waveform on current progress |
autoCenterRate | number |
|
If autoCenter is active, rate at which the waveform is centered |
autoCenterImmediately | boolean |
|
If autoCenter is active, immediately center waveform on current progress |
backend | string |
|
|
backgroundColor | string |
|
Change background color of the waveform container. |
barHeight | number |
|
The height of the wave bars. |
barRadius | number |
|
The radius of the wave bars. Makes bars rounded |
barGap | number |
|
The optional spacing between bars of the wave, if not provided will be calculated in legacy format. |
barWidth | number |
|
Draw the waveform using bars. |
barMinHeight | number |
|
If specified, draw at least a bar of this height, eliminating waveform gaps |
closeAudioContext | boolean |
|
Close and nullify all audio contexts when the destroy method is called. |
container | string | HTMLElement |
|
CSS selector or HTML element where the waveform should be drawn. This is the only required parameter. |
cursorColor | string |
|
The fill color of the cursor indicating the playhead position. |
cursorWidth | number |
|
Measured in pixels. |
drawingContextAttributes | object |
|
false} Drawing context attributes. |
duration | number |
|
Optional audio length so pre-rendered peaks can be display immediately for example. |
fillParent | boolean |
|
Whether to fill the entire container or
draw only according to |
forceDecode | boolean |
|
Force decoding of audio using web audio when zooming to get a more detailed waveform. |
height | number |
|
The height of the waveform. Measured in pixels. |
hideScrollbar | boolean |
|
Whether to hide the horizontal scrollbar when one would normally be shown. |
hideCursor | boolean |
|
Whether to hide the mouse cursor when one would normally be shown by default. |
ignoreSilenceMode | boolean |
|
If true, ignores device silence mode
when using the |
interact | boolean |
|
Whether the mouse interaction will be enabled at initialization. You can switch this parameter at any time later on. |
loopSelection | boolean |
|
(Use with regions plugin) Enable looping of selected regions |
maxCanvasWidth | number |
|
Maximum width of a single canvas in
pixels, excluding a small overlap (2 * |
mediaControls | boolean |
|
(Use with backend |
mediaType | string |
|
(Use with backend |
minPxPerSec | number |
|
Minimum number of pixels per second of audio. |
normalize | boolean |
|
If true, normalize by the maximum peak instead of 1.0. |
partialRender | boolean |
|
Use the PeakCache to improve rendering speed of large waveforms |
pixelRatio | number |
|
The pixel ratio used to calculate display |
plugins | PluginDefinition[] |
|
An array of plugin definitions to
register during instantiation, they will be directly initialised unless they
are added with the |
progressColor | string |
|
The fill color of the part of the
waveform behind the cursor. When |
removeMediaElementOnDestroy | boolean |
|
Set to false to keep the
media element in the DOM when the player is destroyed. This is useful when
reusing an existing media element via the |
renderer | Object |
|
Can be used to inject a custom renderer. |
responsive | boolean | number |
|
If set to |
rtl | boolean |
|
If set to |
scrollParent | boolean |
|
Whether to scroll the container with a lengthy waveform. Otherwise the waveform is shrunk to the container width (see fillParent). |
skipLength | number |
|
Number of seconds to skip with the skipForward() and skipBackward() methods. |
splitChannels | boolean |
|
Render with separate waveforms for the channels of the audio |
splitChannelsOptions | SplitChannelOptions |
|
Options for splitChannel rendering |
vertical | boolean |
|
Render the waveform vertically instead of horizontally. |
waveColor | string |
|
The fill color of the waveform after the cursor. |
xhr | object |
|
XHR options. For example:
|