assassin-bug/src/engine/sound.js

18 lines
439 B
JavaScript
Raw Normal View History

2021-11-05 13:28:01 +00:00
import Resonator from '../framework/resonator';
export default class Sound {
constructor() {
this.res = new Resonator();
this.res.setEnvironmentImpulse(`assets/Greek7EchoHall.wav`);
this.ambience = null;
this.music = null;
this.previousAmbience = null;
this.previousMusic = null;
}
play(file) {
const sound = this.res.loadImmediate(file);
sound.play();
}
}