FMod API Web AudioContext not allowed to start

Hi !
I have a website with FMod audio integration but i have an error with my webbrowser when i load the page. I dont have any sound (FMod API working) and i have this warning on console “The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page”
The page’s audio launches a few times, but it’s not stable at all.
Do I need to create a button to activate FMOD’s audio engine with user interraction ?

Hi,

While the warning you’re observing is expected, FMOD versions 2.02.07 and above should be handling the required resumption/creation by default. I don’t recall having the problem you’re describing when I tested your website project for a previous issue you were running into: FMod Web API Failed to get parameter

What version of FMOD are you using? Also, can you elaborate on what exactly you mean by “not stable” - is it just that you don’t hear any audio, or do you also get artifacting such as stutters?

Thanks for the response
In reality the bug was on the browser side. My site has evolved a lot and as the sound was automatically triggered when the page was launched, the browser was blocking it. I corrected this bug by creating a button to access the page that launched the fmod script at the same time.
For the audio bugs, the website has a script that avoids reloading the page each time it is loaded (to keep fmod audio). However, fmod may randomly rollback when switching from one page to another.
Oh and im using FMod 2.02.09

1 Like

It’s good to hear that you’ve found a solution!

If I’m understanding “rollback” as the system or playing events restarting, this is likely not an issue with the FMOD system, and more likely to be an issue with how the webpage handles making sure the FMOD system/script persists. I would recommend placing your own logging calls in the FMOD script to see whether the script is being partially or completely re-run when it isn’t intended to be.

If it isn’t, you can swap to the logging versions of the FMOD libraries that have the “L” suffix (i.e. “fmodL” or fmodstudioL") , and call Debug_Initialize with the debug flag set to DEBUG_LEVEL_LOG before creating your FMOD system, which will provide more information on what is happening to the FMOD system.