Constructor Summary
Public Constructor | ||
public |
constructor(params: WavesurferParams) Construct the backend |
Method Summary
Public Methods | ||
public |
Create a timer to provide a more precise |
|
public |
destroy() This is called when wavesurfer is destroyed |
|
public |
Returns the current time in seconds relative to the audio-clip's duration. |
|
public |
Used by |
|
public |
Compute the max and min value of the waveform when broken into <length> subranges. |
|
public |
Get the audio source playback rate. |
|
public |
Get the position from 0 to 1 |
|
public |
Get the current volume |
|
public |
init() Initialise the backend, called in |
|
public |
Used by |
|
public |
Create media element with url as its source, and append to container element. |
|
public |
Load existing media element. |
|
public |
Pauses the loaded audio. |
|
public |
Plays the loaded audio region. |
|
public |
Used by |
|
public |
Enable or disable muted audio |
since 4.0.0 |
public |
setPlayEnd(end: number) Set the play end |
|
public |
setPlaybackRate(value: number) Set the audio source playback rate. |
|
public |
Set the sink id for the media player |
|
public |
Set the audio volume |
Inherited Summary
From class WebAudio | ||
public |
ac: * ac: Audio Context instance |
|
public |
analyser: * analyser: provides audio analysis information |
|
public |
audioContext: * audioContext: allows to process audio with WebAudio API |
|
public |
Boolean indicating if the backend was destroyed. |
|
public |
gainNode: * gainNode: allows to control audio volume |
|
public |
scriptNode: * scriptNode: allows processing audio |
|
public |
Create analyser node to perform audio analysis |
|
public |
Create ScriptProcessorNode to process audio |
|
public |
Create the gain node needed to control the playback volume. |
|
public |
destroy() This is called when wavesurfer is destroyed |
|
public |
Destroy all references with WebAudio, disconnecting audio nodes and closing Audio Context |
|
public |
getAudioContext(): AudioContext Get the audio context used by this backend or create one |
|
public |
Returns the current time in seconds relative to the audio-clip's duration. |
|
public |
Used by |
|
public |
getOfflineAudioContext(sampleRate: number): OfflineAudioContext Get the offline audio context used by this backend or create one |
|
public |
Compute the max and min value of the waveform when broken into <length> subranges. |
|
public |
Returns the current playback rate. |
|
public |
Get the position from 0 to 1 |
|
public |
Get the playback position in seconds |
|
public |
Get the current volume |
|
public |
init() Initialise the backend, called in |
|
public |
Used by |
|
public |
Loaded a decoded audio buffer |
|
public |
pause() Pauses the loaded audio. |
|
public |
Plays the loaded audio region. |
|
public |
Used by |
|
public |
Unpacked |
|
public |
setFilters(filters: AudioNode[]) Insert custom Web Audio nodes into the graph |
|
public |
Set the rendered length (different from the length of the audio) |
|
public |
Set pre-decoded peaks |
|
public |
setPlayEnd(end: number) Set a point in seconds for playback to stop at. |
version 3.3.0 |
public |
setPlaybackRate(value: number) Set the audio source playback rate. |
|
public |
Set the sink id for the media player |
|
public |
Set the audio volume |
|
public |
Does the browser support this backend |
Public Constructors
public constructor(params: WavesurferParams) source
Construct the backend
Override:
WebAudio#constructorParams:
Name | Type | Attribute | Description |
params | WavesurferParams | Wavesurfer parameters |
Public Members
public destroyed: boolean source
Boolean indicating if the backend was destroyed.
Override:
WebAudio#destroyedPublic Methods
public getCurrentTime(): number source
Returns the current time in seconds relative to the audio-clip's duration.
Override:
WebAudio#getCurrentTimepublic getPeaks(length: number, first: number, last: number): number[] | Number<Array[]> source
Compute the max and min value of the waveform when broken into
<length> subranges.
Override:
WebAudio#getPeakspublic getPlaybackRate(): number source
Get the audio source playback rate.
Override:
WebAudio#getPlaybackRatepublic getPlayedPercents(): number source
Get the position from 0 to 1
Override:
WebAudio#getPlayedPercentspublic init() source
Initialise the backend, called in wavesurfer.createBackend()
Override:
WebAudio#initpublic isPaused(): boolean source
Used by wavesurfer.isPlaying()
and wavesurfer.playPause()
Override:
WebAudio#isPausedpublic load(url: string, container: HTMLElement, peaks: number[] | Number<Array[]>, preload: string) source
Create media element with url as its source, and append to container element.
Override:
WebAudio#loadThrow:
* |
Will throw an error if the |
public loadElt(elt: HTMLMediaElement, peaks: number[] | Number<Array[]>) source
Load existing media element.
public pause(): Promise source
Pauses the loaded audio.
Override:
WebAudio#pauseEmit:
* |
MediaElement#pause |
public play(start: number, end: number): Promise source
Plays the loaded audio region.
Override:
WebAudio#playEmit:
* |
MediaElement#play |
public seekTo(start: number) source
Used by wavesurfer.seekTo()
Override:
WebAudio#seekToParams:
Name | Type | Attribute | Description |
start | number | Position to start at in seconds |
public setMute(muted: boolean) since 4.0.0 source
Enable or disable muted audio
Params:
Name | Type | Attribute | Description |
muted | boolean | Specify |
public setPlayEnd(end: number) source
Set the play end
Override:
WebAudio#setPlayEndParams:
Name | Type | Attribute | Description |
end | number | Where to end |
public setPlaybackRate(value: number) source
Set the audio source playback rate.
Override:
WebAudio#setPlaybackRateParams:
Name | Type | Attribute | Description |
value | number | Playback rate |
public setSinkId(deviceId: string): Promise source
Set the sink id for the media player
Override:
WebAudio#setSinkIdParams:
Name | Type | Attribute | Description |
deviceId | string | String value representing audio device id. |
public setVolume(value: number) source
Set the audio volume
Override:
WebAudio#setVolumeParams:
Name | Type | Attribute | Description |
value | number | A floating point value between 0 and 1. |