AudiokineticのコミュニティQ&AはWwiseやStrataのコミュニティ内でユーザ同士が質問・回答をし合うことができるフォーラムです。Audiokineticテクニカルサポートチームからの回答をご希望の場合は、必ず サポートチケットページ をご利用ください。

Music synchronization and callbacks with PostTrigger

0 支持
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
Olivier F. (140 ポイント) 2020 3/27 質問 General Discussion

回答 2

0 支持
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
‪Dean k. (150 ポイント) 2020 4/20 回答
0 支持
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 ;)
Olivier F. (140 ポイント) 2020 4/21 回答
...