Files
JiboOs/docs/sound/tasks/SoundTask.js
2026-03-16 13:53:01 +02:00

68 lines
1.8 KiB
JavaScript

/**
* Internal class for dealing with async load assets through Loader.
* @class SoundTask
* @extends jibo.loader.Task
* @memberof jibo.loader
* @constructor
* @private
* @param {Object} asset The data properties.
* @param {String} asset.src The source.
* @param {Boolean} [asset.cache=false] true to cache the result.
* @param {String} [asset.id] ID of asset.
*/
/**
* Tests if tasks should be run.
* @method jibo.loader.SoundTask.test
* @static
* @param {Object} asset The asset to check.
* @return {Boolean} true if the asset is compatible with this asset.
*/
/**
* The source URL to load.
* @type {String}
* @name jibo.loader.SoundTask#src
*/
/**
* true to block the audio from being played more than once at a time.
* @type {Boolean}
* @name jibo.loader.SoundTask#block
*/
/**
* The initial volume of the sound (0 to 1).
* @type {Number}
* @name jibo.loader.SoundTask#volume
*/
/**
* The panning from -1 (left) to 1 (right). Default is 0 (center).
* @type {Number}
* @name jibo.loader.SoundTask#panning
*/
/**
* true if the sound should play.
* @type {Boolean}
* @name jibo.loader.SoundTask#loop
*/
/**
* true to start playing the sound immediately after loading.
* @type {Boolean}
* @name jibo.loader.SoundTask#autoPlay
*/
/**
* true to use XMLHttpRequest to download file.
* @type {Boolean}
* @name jibo.loader.SoundTask#useXHR
*/
/**
* Starts the task.
* @method jibo.loader.SoundTask#start
* @param {jibo.loader.Task~completeCallback} callback Callback when finished.
*/