Fixed audio not loading if tsv file didn't load any audio.
Made list of mstids an array of allowed mstids instead of making a weird if block for allowed ids.
This commit is contained in:
parent
72cc69cb0b
commit
5d51d0f2a9
3 changed files with 13 additions and 8 deletions
14
Js/Audio.js
14
Js/Audio.js
|
@ -153,12 +153,18 @@ class audioController {
|
|||
}
|
||||
|
||||
loadSounds(soundMap, callback) {
|
||||
this.loader = new bufferLoader(this.audioCtx, soundMap, (percent) => {
|
||||
if(!soundMap || soundMap.length === 0) {
|
||||
if (callback) {
|
||||
callback(percent);
|
||||
callback(100);
|
||||
}
|
||||
});
|
||||
this.loader.load();
|
||||
} else {
|
||||
this.loader = new bufferLoader(this.audioCtx, soundMap, (percent) => {
|
||||
if (callback) {
|
||||
callback(percent);
|
||||
}
|
||||
});
|
||||
this.loader.load();
|
||||
}
|
||||
}
|
||||
|
||||
resetAll() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue