Home Reference Source Test
import PeakCache from 'wavesurfer.js/src/peakcache.js'
public class | source

PeakCache

Caches the decoded peaks data to improve rendering speed for large audio

Is used if the option parameter partialRender is set to true

Constructor Summary

Public Constructor
public

Instantiate cache

Method Summary

Public Methods
public

addRangeToPeakCache(length: number, start: number, end: number): Number<Array[]>

Add a range of peaks to the cache

public

Empty the cache

public

For testing

Public Constructors

public constructor() source

Instantiate cache

Public Methods

public addRangeToPeakCache(length: number, start: number, end: number): Number<Array[]> source

Add a range of peaks to the cache

Params:

NameTypeAttributeDescription
length number

The length of the range

start number

The x offset of the start of the range

end number

The x offset of the end of the range

Return:

Number<Array[]>

Array with arrays of numbers

Test:

public clearPeakCache() source

Empty the cache