fix sound issues

This commit is contained in:
LabyStudio
2022-02-13 08:10:28 +01:00
parent c955fdc7f9
commit b7b3439f0d
2 changed files with 25 additions and 18 deletions
@@ -38,7 +38,9 @@ window.SoundManager = class {
}
loadSound(path) {
let scope = this;
if (!this.isCreated()) {
return;
}
// Create sound
let sound = new THREE.PositionalAudio(this.audioListener);
@@ -47,6 +49,7 @@ window.SoundManager = class {
sound.setFilter(sound.context.createBiquadFilter());
// Load sound
let scope = this;
this.audioLoader.load(path, function (buffer) {
sound.setBuffer(buffer);
scope.scene.add(sound);