Skip to content

Commit

Permalink
Call StartAudioContext later
Browse files Browse the repository at this point in the history
To ensure that the audio context is actually valid
Some browsers let you create an AudioContext but it will throw when you
try to use it.
  • Loading branch information
GarboMuffin committed Sep 24, 2023
1 parent 30e31c4 commit 5307e9a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/AudioEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class AudioEngine {
* @type {AudioContext}
*/
this.audioContext = audioContext;
StartAudioContext(this.audioContext);

/**
* Master GainNode that all sounds plays through. Changing this node
Expand All @@ -75,6 +74,8 @@ class AudioEngine {
* Left is closest to input, Right is closest to output
*/
this.effects = [PanEffect, PitchEffect, VolumeEffect];

StartAudioContext(this.audioContext);
}

/**
Expand Down

0 comments on commit 5307e9a

Please sign in to comment.