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.

0 votes

Hi, I would like to get my Unity game working on Web with Wwise and I followed the steps in the Wwise WebGL Unity integration with addressables guide, but it doesn't seem to work. The game builds but opens with error. I'm wondering if anyone who has recently gotten their game working on the Web with Wwise could offer some guidance. Is the video tutorial perhaps outdated, or could I be missing something? Any help would be greatly appreciated, thanks in advance!

in General Discussion by Anthony Gunadi (100 points)
I managed to get this working, after significant pain and fixing some errors in the code.

I used Wwise 2024.1.5, alongside Unity 6000.0.50f1 as reference. I'm starting from a fresh Unity project that you have opened once, then used the Wwise Launcher to Integrate 2024.1.5 into the project.

1. You need to grab the Wwise Unity Addressables ZIP file off the Git. The specific file you need is not a main release, but you need to ensure you go into "Tags" and grab "v24.1.5" this corresponds to "20"24.1.5 Wwise Version. In any future cases in the documentation it states the Addressables packages are labelled this way and not always posted as a main release.

2. Place this unzipped folder in the Unity Project's "Packages" folder. Then open the project in Unity and change in Project Settings the Wwise Integration settings, near the bottom, to "from file location" instead of "from Github". Change the Package Source to :

../Packages/WwiseUnityAddressables-24.1.5
Assuming your folder isn't nested.

Do not install at this point! Close the project.

Open the manifest.json located in your Unity Project/Packages and add/change the line under "dependencies" at the top to :
"com.audiokinetic.wwise.addressables":

"file:../Packages/WwiseUnityAddressables-24.1.5",

We're using relative pathing inside the folder since anyone else who grabs the project off your Git repo or something needs it to be relative or it will break the project for them.

3. Do the normal Wwise Addressables Installer stuff. Make some test sounds, setup your banks, etc. Then reopen your Unity Project and choose to Install Addressables. It should work at this point. If you have issues where your banks are not *addressable assets* and have blank page icons in the Unity Project it means something is wrong. I managed to get it to function from that point by removing everything in the Assets/WwiseData/Banks (Make sure to do this IN UNITY EXPLORER) and using the Wwise Picker to regenerate the Soundbanks.

4. Important. I do not have a record of what I fixed in the code, when I attempted to build a test WebGL build it failed partway through with an error pointed to line 200something of a AK .cs file. In that file there was greyed out code related to "If Wwise.UnityWebGL and !Unity.Editor" ~ something. In there the code is missing a cast before an "await" that is similar to the code that is after this error also. You need to add that cast in the same spot in the code, you can get a reference for what it is by copying the code near where this error is.

If you managed to get through all of this, I applaud you like I did when I was relieved that it actually managed to work. Hopefully this works for others, and good luck!

1 Answer

0 votes

Hi, I successfully integrated Wwise 2024.4 into Unity 6 and was able to run it normally in WebGL. However, I didn’t follow the method shown in the video, since my project uses YooAsset instead of Addressables. Still, I hope my approach gives you some ideas.

First of all, this method should work with any hot update solution, not just Addressables or YooAsset. It doesn’t rely on third-party plugins, but it does require some modifications to the Wwise integration code.

AOT Part

  • Define a LoadBankFromBytes function that uses AkUnitySoundEngine.LoadBankMemoryCopy to load SoundBanks.

  • Modify the Wwise code to stop using the built-in LoadInitBank, and instead load Init.bnk via LoadBankFromBytes.

  • Don’t add AkAudioListener or AkInitializer in the default scene.

HotUpdate Part

  • In your hot update code entry point, manually load the binary SoundBank files such as Init.bnk.bytes, Music.bnk.bytes, etc.

  • Load the prefab with AkInitializer attached to perform initialization. If everything’s working, it should call your custom LoadBankFromBytes to load Init.bnk.

  • Manually attach AkGameObj and AkAudioListener to the Main Camera.

  • Use LoadBankFromBytes to load your other SoundBanks, like Music.bnk.

  • After that, everything should work normally—for example, you can trigger your Wwise Events like this: AkUnitySoundEngine.PostEvent("Play_BGM", gameObject).

Hope this helps you out ;D

by Luy Zh (180 points)
...