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.

+3 votes

Hi,

I'm new to Wwise and I recently integrated it into a Unity project of mine. I am running into an error where I am getting an error message:
Unity Version: 2022.1.5f1
Wwise Version: 2021.1.9.7847

The error message is:
WwiseUnity: Unable to load Wwise Data: UnityEngine.UnityException: LoadAssetAtPath can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
  at (wrapper managed-to-native) UnityEditor.AssetDatabase.LoadAssetAtPath(string,System.Type)
  at UnityEditor.AssetDatabase.LoadAssetAtPath[T] (System.String assetPath) [0x00001] in <5db21055c88447d49afcd8d90f76e7f1>:0 
  at AkWwiseProjectInfo.GetData () [0x0001f] in C:\Users\shawn\OneDrive\Desktop\Game Design\GameDev\Unity\UnityProjects\SquareOff\Assets\Wwise\API\Editor\WwiseWindows\AkWwiseProjectInfo.cs:72 
UnityEngine.Debug:LogError (object)

This is whenever I enter Play Mode in Unity.


Per a previous post: https://www.audiokinetic.com/qa/1248/unity-unable-to-load-wwise-data
I set the folder at Assets/Wwise/Editor/ProjectData to be write-enabled. It however did not fix my issue.

I'm not sure what to do here. Happy to share more information as needed.

Thanks,
Shawn

in General Discussion by Shawn H. (170 points)
I got the same error... and I can't find anything on the internet about this error. My unity version is also 2022.1.4f1, wwise version is 2021.1.9.7847 also.

Is it possible the error is due to the new version of both softwares? Really strange. Hope someone can help us.
Hi, Have guys found the solution? I ran into the exact same problem
I found I made a mistake of not adding the event into the sound bank in Wwise, that resolves my problem.
I'm also having this problem. Wwise version 2021.1.9.7847, Unity 2022.1.8f1. I've tried making sure things are writeable as well and it doesn't solve it. Thing is, I'm pretty sure I caused this once I told SourceTree to stop tracking the AkWwiseProjectData folder because it kept popping up...
And when I mark it writeable, then running Unity play mode makes it read-only again. So it's probably not an access violation exception, since Unity appears to be changing the files on entering Play Mode. I'm thinking something is going wrong with the code that builds the asset directory...
This is my problem too.
I'm also getting this error. Unity 2022.1.23f1, Wwise 2022.1.0 (Build 8070).

From what I can tell, this error is generated by a Wwise editor window in Unity trying to load an asset. Happens when entering Play mode.

Tried to set the ProjectData folder to writable, but the error didn't go away.

2 Answers

0 votes
I ended up restarting my machine and the problem did resolve, however I am not sure why. I don't know if this is a proper solution to this issue or if it might resolve it for other people.
by Shawn H. (170 points)
0 votes
  • Check to see if you use Jobs, Unselect Jobs->Burst->Enable Compilation

by JIAMIN Q. (140 points)
...