Optional
cacheSize: number = ...The maximum cache size in bytes. 1GB by default.
Private
#maxThe maximum cache size in bytes.
Private
#memoryThe current memory utilization in bytes.
Private
#headThe head of the doubly-linked list.
Private
#tailThe tail of the doubly-linked list
A string representation of the current cache utilization.
Insert an AudioBuffer into the buffers cache.
The audio buffer source path
The audio buffer to insert
Private
#insertInsert a new node into the cache, updating the linked list and cache size.
The node to insert
Private
#removeRemove a node from the cache, updating the linked list and cache size.
The node to remove
Private
#shiftShift an accessed node to the head of the linked list.
The node to shift
Private
#expireRecursively expire entries from the cache in least-recently used order. Skip expiration of any entries which are locked.
Optional
node: AudioBufferCacheEntryA node from which to start expiring. Otherwise, starts from the tail.
Construct an AudioBufferCache providing a maximum disk size beyond which entries are expired.