Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wait until the last minute to load sounds #118

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aaron13100
Copy link

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.

note that this is too late for the first firework and .init() must be called earlier if the sound for the first firework is to work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant