Community Q&A

Where Wwise users help each other out!

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

Failed to prepare event without errors

0 votes

Based on Unity 2018.4.14, Wwise 2019.2.2

I'm trying to play BGM in the game. (We use different states to control the different music.)
The following is my codes' steps:
1. PrepareBank
2. PrepareEvent
3. PostEvent
4. PrepareGameSyncs
5. SetState
No sounds come out.
So I set a break point after the bank was prepared successfully to pause the Game. Then start the wwise communication with unity to see the errors. Resume the game after wwise and unity is connected.
But no errors shown up in the Capture-Log-View. There are only two lines of logs:
Prepare event request received (Array size = 1)
Failed to prepare event

There is also no errors in visual studio. But the callback's the argument in_eLoadResult is AK_Fail.

asked Jun 23 in General Discussion by Isabella D. (250 points)
edited Jun 28 by Isabella D.

1 Answer

0 votes
Best answer

1. Make sure the enable_game_sync_preparation setting is on.
Unity Editor -> Edit -> Project Settings -> Wwise Initialization -> Enable Game Sync Preparation
But in my case, it was still going wrong.

2. Finally, I found out that the order matters.
I should PrepareGameSync before PrepareEvent.
The sound comes out when the order is 1-4-2-3-5, while no sound comes out when the order is 1-2-4-3-5.
It is inconsistent with the notes of official website:

The order in which you call AK::SoundEngine::PrpareEvent and AK::SoundEngine::PrepareGameSync is not important.

So, the official website notes is misleading, or it is a wwise's bug?

answered Jun 28 by Isabella D. (250 points)
So, I finally get this.
When the media is controlled by more than one State, I should have prepared every group before play the event.
It's true that the order to call PrepareEvent and PrepareGameSyncs does not matter.