Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

0 votes
Hi everybody,

For a musical game developped with Unity3D, I have a background music (used to define the beat) and I need to have some short sequences (a few seconds) launched randomly on the beat.
Those sequences must be synchronized with background music, so I'm using Stinger in Wwise to do launch the sequence on next beat.

OK, It is working fine...except that in Unity, I cannot use events callbackswith posttrigger (so, I cannot know if and when the sequence start playing, the source position, neither the end of the sequence).
It's problematic for me, because each sequence is a short gameplay phase, and I really need this information to be accurate.
I tried to extrapolate those information (on the assumption that next beat corresponds to sequence starting time), but :
1) it is not very accurate and can lead to bugs and errors
2) I need to enter manually custom cues and sequence duration times in Unity...I have a lot of sequence, so it can be fastidious and an errors source

Is there a way to use callbacks (or tho have information about sequences played) with stingers / post triggers ?

I also tried another approach : listening AkCallbackType.AK_MusicSyncBeat events on the background music, and posting the sequence event on the next beat via Unity.
But I'm afraid to encounter synchronization problem with this method...do you think it can be the case ?

Else, would you have a third solution to do this (have a sequence synchronized on background music, and be able to recover playing information, including custom cues) ?

Many thanks in advance for your help
in General Discussion by Olivier F. (140 points)

2 Answers

0 votes
Hey olivier,

Sorry if i got you hyped for an answer.

I just encountered the same issue, if you found a solution by now i would be glad to hear about it.

 

Dean
by ‪Dean k. (150 points)
0 votes
Hi,

I finally found a solution : using "GetPlayingSegmentInfo" on the background music...
When I receive my beat information, I post the trigger, then, on next beat, I get the segment info (and so, the read position in the background music).
Then I store this information as the "Start Time" of the sequence.
Every time I need to have a relative time in the sequence, I just do "music segment info" - Start Time.

This way, the sequence is launched with stingers, but I have accurate timing for gameplay phases.

Hope it's clear and it helped ;)
by Olivier F. (140 points)
...