Skip to content

Commit 105fc48

Browse files
committed
WG-70606: Updates for Wwise 23.1.2 release
WG-69952: Wwise Addressables Package Version is outdated WG-70321: WebGL cannot load banks synchronously. Change-Id: Ic37e9947f4ecd3ec95a01080aa957bb843a89e31
1 parent 97a157d commit 105fc48

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

Runtime/AkAddressableBankManager.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,20 @@ public async Task LoadBankAsync(WwiseAddressableSoundBank bank, AssetReferenceWw
273273
{
274274
var asyncHandle = bankData.LoadAssetAsync<WwiseSoundBankAsset>();
275275
WwiseSoundBankAsset soundBankAsset;
276-
if(loadAsync)
276+
#if UNITY_WEBGL && !UNITY_EDITOR
277+
// On WebGL, we MUST load asynchronously in order to yield back to the browser.
278+
// Failing to do so will result in the thread blocking forever and the asset will never be loaded.
279+
soundBankAsset = await asyncHandle.Task;
280+
#else
281+
if (loadAsync)
277282
{
278283
soundBankAsset = await asyncHandle.Task;
279284
}
280285
else
281286
{
282287
soundBankAsset = asyncHandle.WaitForCompletion();
283288
}
289+
#endif
284290
//AsyncHandle gets corrupted in Unity 2021 but properly returns the loaded Asset as expected
285291
#if UNITY_2021_1_OR_NEWER
286292
if (soundBankAsset)
@@ -338,8 +344,13 @@ public async Task LoadBankAsync(WwiseAddressableSoundBank bank, AssetReferenceWw
338344
{
339345
AkAssetUtilities.UpdateWwiseFileIfNecessary(WriteableMediaDirectory, streamingMedia);
340346
}, Addressables.MergeMode.Union, false);
341-
347+
#if UNITY_WEBGL && !UNITY_EDITOR
348+
// On WebGL, we MUST load asynchronously in order to yield back to the browser.
349+
// Failing to do so will result in the thread blocking forever and the asset will never be loaded.
350+
await streamingAssetAsyncHandle.Task;
351+
#else
342352
streamingAssetAsyncHandle.WaitForCompletion();
353+
#endif
343354

344355
Addressables.Release(streamingAssetAsyncHandle);
345356
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.audiokinetic.wwise.addressables",
3-
"version": "2022.1.0",
3+
"version": "2023.1.2",
44
"displayName": "Wwise Unity Addressables",
55
"description": "Wwise Unity Addressables",
66
"unity": "2018.4",

0 commit comments

Comments
 (0)