function loadSounds(obj, context, soundMap, callback) {
    var names = [];
    var paths = [];
    for (var name in soundMap) {
        var path = soundMap[name];
        names.push(name);
        paths.push(path);
    }
    let bufferLoader = new BufferLoader(context, paths, function(bufferList) {
        for (var i = 0; i < bufferList.length; i++) {
            var buffer = bufferList[i];
            var name = names[i];
            obj[name] = buffer;
        }
        if (callback) {
            callback();
        }
    });
    bufferLoader.load();
}
/**
 * Helper function for loading one or more sound files
 */
Helper function for loading one or more sound files
Helper function for loading one or more sound files
function loadSounds(obj, context, soundMap, callback) {
    var names = [];
    var paths = [];
    for (var name in soundMap) {
        var path = soundMap[name];
        names.push(name);
        paths.push(path);
    }
    let bufferLoader = new BufferLoader(context, paths, function(bufferList) {
        for (var i = 0; i < bufferList.length; i++) {
            var buffer = bufferList[i];
            var name = names[i];
            obj[name] = buffer;
        }
        if (callback) {
            callback();
        }
    });
    bufferLoader.load();
}
function loadSounds ( obj , context , soundMap , callback ) { var names = [ ] ; var paths = [ ] ; for ( var name in soundMap ) { var path = soundMap [ name ] ; names . push ( name ) ; paths . push ( path ) ; } let bufferLoader = new BufferLoader ( context , paths , function ( bufferList ) { for ( var i = 0 ; i < bufferList . length ; i ++ ) { var buffer = bufferList [ i ] ; var name = names [ i ] ; obj [ name ] = buffer ; } if ( callback ) { callback ( ) ; } } ) ; bufferLoader . load ( ) ; }
Helper function for loading one or more sound files
Helper function for loading one or more sound files