Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

WebGL Build does not play sounds despite no error messages or build issues

0 votes

Using the Experimental Web Platform and following all steps from Setting up Web Platform in the Wwise project, Installing the Wwise Unity Addressables Package and Changing the settings in Unity all the addressables banks build fine.

We build the WebGL builds exactly like the Windows and macOS builds by building the addressables after switching platform and building the project like regular Unity projects.

Sounds still work in Windows and Mac Builds, but WebGL build does not have any sounds despite the development build showing no error messages on runtime and the game running flawlessly. We have tried playing release and dev builds in Edge and Chrome.

Does anybody know where those issues could stem from?

asked Sep 15, 2023 in General Discussion by Gérald Montúfar (110 points)

1 Answer

+1 vote
Hi there,

There are many different things that could cause this problem. It could be a failure in sink initialization, failure to serve the web page with proper CORS headers, failures to load the asset bundles containing the banks and media, or simply the web browser defaulting to a muted state.

Are there any errors popping up in the Console Log tab of the Dev Tools pane in Chrome? Usually, this is where you would see any errors generated by Wwise.

If nothing shows up there, you may want to try connecting the Wwise Profiler and see if the sound engine is actually processing audio events. Note that to connect the profiler to a web page, you will need to use the proxy server that ships with the Wwise SDK; please make sure to consult the offline documentation for the Experimental Web Platform.
answered Sep 15, 2023 by Philippe M. (540 points)
Thanks for the tip with the Dev Tools pane.

You are right. I get quite a few errors in the Console Log tab of the Dev Tools pane.
First I get a "Failed to load resource: the server responded with a status of 404 (Not found)" but then all the Unity logs start and the game get's initialised.
Afterwards Wwise logs start.
1. Sound engine gets initialised successfully
2. Loading init bank
3. Main bank will be loaded after init bank
4. Error: WebSocket connection to 'ws://localhost:8095/' failed : 5942110 @ WebGL_Dev.framework.js:2000
5. Wwise WebSocket error: Event -> target: WebSocket -> binaryType: "array buffer"

Then Loaded Init bank with bank id, Loaded Main bank without bank id
Then I get a couple "Wwise Audio Context creation failures: ReferenceError: SharedArrayBuffer is not defined"
Loaded Main bank with bank id
Then [UnityCache] ‘https://localhost:51742/StreamingAssets/aa/WebGL/wwisedata_web_assets_all_....bundle' successfully downloaded and stored in the indexedDB cache
Then for each sound played "Wwise Audio Context creation failures: ReferenceError: SharedArrayBuffer is not defined" again.

I guess the "WebSocket connection failed" will be the root of the problem but I unfortunately have no clue how I could remedy this issue.
...