Methods
-
Loads and returns an audio file
Name Type Description object
String | WebAudio | Array | Object Path to file or WebAudio or array with parameters or object with parameters filename
String optional Name of file (if object is String) listener
function optional Function of processing after loading an audio file (if object is String) object.folder
String Path to file object.filename
String Name of file object.listener
function 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 object
String | WebAudio | Array | Object Path to file or WebAudio or array with parameters or object with parameters filename
String optional Name of file (if object is String) listener
function optional Function of processing after loading an audio file (if object is String) object.folder
String Path to file object.filename
String Name of file object.listener
function 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 buffers
Array.<WebAudio> | Array.<Object> Audio files to load onLoadAllBuffers
function Function that is called when all audio files are loaded and ready onLoadSomeBuffer
function optional Function that is called when some audio file are loaded and ready object[].folder
String Path to file object[].filename
String Name of file object[].listener
function 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 buffers
Array.<WebAudio> | Array.<Object> Audio files to load object[].folder
String Path to file object[].filename
String Name of file object[].listener
function optional Function of processing after loading an audio file Returns:
Type Description Promise.<Array.<WebAudio>> Loaded audio files