We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b05a18 commit 2246983Copy full SHA for 2246983
src/board/audio/index.ts
@@ -67,10 +67,12 @@ export class Audio {
67
}
68
69
async createAudioContextFromUserInteraction(): Promise<void> {
70
- this.context = new (window.AudioContext || window.webkitAudioContext)({
71
- // The highest rate is the sound expression synth.
72
- sampleRate: 44100,
73
- });
+ this.context =
+ this.context ??
+ new (window.AudioContext || window.webkitAudioContext)({
+ // The highest rate is the sound expression synth.
74
+ sampleRate: 44100,
75
+ });
76
if (this.context.state === "suspended") {
77
return this.context.resume();
78
0 commit comments