Home Reference Source
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[][]

Add a range of peaks to the cache

public

Empty the cache

public

getCacheRanges(): number[][]

For testing

Public Constructors

public constructor() source

Instantiate cache

Public Methods

public addRangeToPeakCache(length: number, start: number, end: number): number[][] 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[][]

public clearPeakCache() source

Empty the cache

public getCacheRanges(): number[][] source

For testing

Return:

number[][]