fireworks-js icon indicating copy to clipboard operation
fireworks-js copied to clipboard

wait until the last minute to load sounds

Open aaron13100 opened this issue 1 year ago • 0 comments

Checklist

Feel free to reject this or change it. It's untested as I can't get the project to build/compile. On my JavaScript version I had to separate out the initialization of audioContext in order for the sound to work on the first firework, like this.

  init() {
    if (this.audioContext == null) {
      this.audioContext = new (window.AudioContext || window.webkitAudioContext)();
      this.loadSounds();
    }
    if (!this.onInit && this.isEnabled) {
      this.onInit = true;
    }
  }

but it looks like what I committed in typescript will work.

aaron13100 avatar Nov 28 '23 13:11 aaron13100