mosra / magnum-examples

Examples for the Magnum C++11 graphics engine
https://magnum.graphics/
The Unlicense
282 stars 95 forks source link

Audio Example not working #104

Closed ThreeDeeJay closed 1 year ago

ThreeDeeJay commented 1 year ago

https://magnum.graphics/showcase/audio/ doesn't play any audio on my end. Tested on recent Chromium and Firefox (webgl1 enabled). Also according to someone else:

I get this in Vivaldi's console: The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://developer.chrome.com/blog/autoplay/ So, yeah, looks like some media policy thing.

Squareys commented 1 year ago

The page requires a "user gesture" to get permission to play audio or video. Either delay the audio playback or app execution on click/key press or click really fast before the application starts :)

This is a recent change in Chrome and the example doesn't do anything to work around this browser security policy yet.

ThreeDeeJay commented 1 year ago

Interesting. I managed to get it working by spamming click, tho it just sounds like regular stereo panning without HRTF, which I don't think is spatialized, just positional; unless that's the intended effect... or maybe it's just another bug 🤔