SoundCache

Description

API to manage sound cache resources.

Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts • Server Entity Scripts • Assignment Client Scripts

Properties

Name Type Summary
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

Name Return Value Summary
getResourceList Array.<string> Get the list of all resource URLs.
getSound SoundObject Loads the content of an audio file into a SoundObject, ready for playback by Audio.playSound.
prefetch ResourceObject Prefetches a resource.
updateTotalSize None

Signals

Name Summary
dirty

Method Details

(static) getResourceList( ) → {Array.<string>}
Returns: Array.<string>

Get the list of all resource URLs.

(static) getSound( url ) → {SoundObject}
Returns: The sound ready for playback.

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.
(static) prefetch( url ) → {ResourceObject}
Returns: ResourceObject

Prefetches a resource.

Parameters

Name Type Description
url string URL of the resource to prefetch.
(static) updateTotalSize( deltaSize )

Parameters

Name Type Description
deltaSize number

Signal Details

dirty( )
Returns: Signal