Skip to main content
Version: Phaser v4.0.0-rc.6

AudioSpriteFile

An Audio Sprite File suitable for loading by the Loader.

These are created when you use the Phaser.Loader.LoaderPlugin#audioSprite method and are not typically created directly.

For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#audioSprite.

Constructor

new AudioSpriteFile(loader, key, jsonURL, [audioURL], [audioConfig], [audioXhrSettings], [jsonXhrSettings])

Parameters

nametypeoptionaldescription
loaderPhaser.Loader.LoaderPluginNoA reference to the Loader that is responsible for this file.
keystring | Phaser.Types.Loader.FileTypes.AudioSpriteFileConfigNoThe key to use for this file, or a file configuration object.
jsonURLstringNoThe absolute or relative URL to load the json file from. Or a well formed JSON object to use instead.
audioURLObjectYesThe absolute or relative URL to load the audio file from. If empty it will be obtained by parsing the JSON file.
audioConfiganyYesThe audio configuration options.
audioXhrSettingsPhaser.Types.Loader.XHRSettingsObjectYesAn XHR Settings configuration object for the audio file. Used in replacement of the Loaders default XHR Settings.
jsonXhrSettingsPhaser.Types.Loader.XHRSettingsObjectYesAn XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings.

Scope: static

Extends

Phaser.Loader.MultiFile

Source: src/loader/filetypes/AudioSpriteFile.js#L15
Since: 3.7.0

Inherited Methods

From Phaser.Loader.MultiFile:


Public Methods

addToCache

<instance> addToCache()

Description:

Adds this file to its target cache upon successful loading and processing.

Source: src/loader/filetypes/AudioSpriteFile.js#L121
Since: 3.7.0


onFileComplete

<instance> onFileComplete(file)

Description:

Called by each File when it finishes loading.

Parameters:

nametypeoptionaldescription
filePhaser.Loader.FileNoThe File that has completed processing.

Overrides: Phaser.Loader.MultiFile#onFileComplete

Source: src/loader/filetypes/AudioSpriteFile.js#L85
Since: 3.7.0


Inherited Members

From Phaser.Loader.MultiFile: