Methods
-
Loads and returns an audio file
Name Type Description objectString | WebAudio | Array | Object Path to file or WebAudio or array with parameters or object with parameters filenameString optional Name of file (if object is String) listenerfunction optional Function of processing after loading an audio file (if object is String) object.folderString Path to file object.filenameString Name of file object.listenerfunction optional Function of processing after loading an audio file Returns:
Type Description WebAudio | null Loaded audio file or null -
Loads and returns an audio file Asynchronous version of DKTools.Utils.WebAudio.load Promise resolves a loaded audio file
Name Type Description objectString | WebAudio | Array | Object Path to file or WebAudio or array with parameters or object with parameters filenameString optional Name of file (if object is String) listenerfunction optional Function of processing after loading an audio file (if object is String) object.folderString Path to file object.filenameString Name of file object.listenerfunction optional Function of processing after loading an audio file Returns:
Type Description Promise.<(WebAudio|null)> Loaded audio file or null -
Loads a audio files and call the callback function when all audio files are ready
Name Type Description buffersArray.<WebAudio> | Array.<Object> Audio files to load onLoadAllBuffersfunction Function that is called when all audio files are loaded and ready onLoadSomeBufferfunction optional Function that is called when some audio file are loaded and ready object[].folderString Path to file object[].filenameString Name of file object[].listenerfunction optional Function of processing after loading an audio file Example
var buffers = []; buffers[0] = AudioManager.createBuffer('bgm', 'Battle1'); buffers[1] = { folder: 'bgm', filename: 'Battle2' }; DKTools.Utils.WebAudio.loadBuffers(buffers, function(allBuffers) { // all loaded buffers }); -
Asynchronously loads an audio files Promise resolves a loaded audio files
Name Type Description buffersArray.<WebAudio> | Array.<Object> Audio files to load object[].folderString Path to file object[].filenameString Name of file object[].listenerfunction optional Function of processing after loading an audio file Returns:
Type Description Promise.<Array.<WebAudio>> Loaded audio files