SoundCache

Available in: Interface Scripts Client Entity Scripts Server Entity Scripts Assignment Client Scripts

API to manage sound cache resources.
Methods

Signals

Properties:
Name Type Description
numTotal number Total number of total resources. Read-only.
numCached number Total number of cached resource. Read-only.
sizeTotal number Size in bytes of all resources. Read-only.
sizeCached number Size in bytes of all cached resources. Read-only.

Methods

getResourceList() → {Array.<string>}
Get the list of all resource URLs.
Returns:
Type: Array.<string>
getSound(url) → {SoundObject}
Loads the content of an audio file into a SoundObject, ready for playback by Audio.playSound.
Parameters:
Name Type Description
url string The URL of the audio file to load — Web, ATP, or file. See SoundObject for supported formats.
Returns:
The sound ready for playback.
Type: SoundObject
prefetch(url, extraopt) → {ResourceObject}
Prefetches a resource.
Parameters:
Name Type Attributes Default Description
url string URL of the resource to prefetch.
extra object <optional>
null
Returns:
Type: ResourceObject
updateTotalSize(deltaSize)
Parameters:
Name Type Description
deltaSize number

Signals

dirty() → {Signal}
Returns:
Type: Signal