michaelongaro
michaelongaro
TTCTheo's Typesafe Cult
Created by michaelongaro on 10/28/2023 in #questions
Unable to create an AudioContext in Safari
I am almost done with my T3 stack project that heavily relies on the Web Audio API, but have just started testing on safari through Playwright (since I don't have an iphone), and am really at a loss for why I get the error message: "ReferenceError: can't find variable: AudioContext" from the line "const audioContext = new AudioContext()". I have tried all of the popular solutions online (delaying creation until user input + using "window.webkitAudioContext") but this seriously feels like a bug with safari to me. Any help or insights would be greatly appreciated! Repo: https://github.com/michaelongaro/Autostrum ^ file that creates the AudioContext: https://github.com/michaelongaro/Autostrum/blob/a6023dd1deb0935b148902ece517a416920caebd/src/components/Layouts/GeneralLayoutStatefulShell.tsx#L104 Live site: https://www.autostrum.com/
4 replies