Loader#audiosprite()

audiosprite(key, urls, jsonURL, jsonData, autoDecode) → {Phaser.Loader}

A legacy alias for Loader.audioSprite. Please see that method for documentation.

Parameters
Name Type Argument Default Description
key string

Unique asset key of the audio file.

urls Array | string

An array containing the URLs of the audio files, i.e.: [ 'audiosprite.mp3', 'audiosprite.ogg', 'audiosprite.m4a' ] or a single string containing just one URL.

jsonURL string <optional>
null

The URL of the audiosprite configuration JSON object. If you wish to pass the data directly set this parameter to null.

jsonData string | object <optional>
null

A JSON object or string containing the audiosprite configuration data. This is ignored if jsonURL is not null.

autoDecode boolean <optional>
true

When using Web Audio the audio files can either be decoded at load time or run-time.
Audio files can't be played until they are decoded and, if specified, this enables immediate decoding. Decoding is a non-blocking async process, however it consumes huge amounts of CPU time on mobiles especially.

Returns

This Loader instance.

Source code: loader/Loader.js (Line 1093)
doc_phaser
2017-02-14 10:54:18
Comments
Leave a Comment

Please login to continue.