u3d-community / U3D

Open-source, cross-platform 2D and 3D game engine built in C++
https://u3d.io
MIT License
187 stars 30 forks source link

Audio fails on web without user interaction #53

Closed SirNate0 closed 1 year ago

SirNate0 commented 1 year ago

The audio fails unless the user clicks the page before the game starts. Firefox reports the following warning in the console:

An AudioContext was prevented from starting automatically. It must be created or resumed after a user gesture on the page.

The issue happens on Sample 14: SoundEffects, so I don't think it's just an issue with my code.


Discussed upstream in SDL here: https://github.com/libsdl-org/SDL/issues/6385