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

getResource(url, fallbackopt, extraopt) → {object}
Asynchronously loads a resource from the specified URL and returns it.
Parameters:
Name Type Attributes Default Description
url string URL of the resource to load.
fallback string <optional>
"" Fallback URL if load of the desired URL fails.
extra <optional>
null
Returns:
Type: object
getResourceList() → {Array.<string>}
Get the list of all resource URLs.
Returns:
Type: Array.<string>
getSound(url) → {SoundObject}
Parameters:
Name Type Description
url string
Returns:
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