Hi everybody,
I'm currently working on an Unity musical game project with a classical gameplay "press the key when you hear the note".
But I'm having some strange results with GetPlayingSegmentInfo that seems to give wrong position information compared to what is heard.
Lets take an example to explain the problem : i have some notes placed at every beats in a short sequence (time relative to sequence start : 0, 1000ms, 2000ms, 3000ms ...).
If I press my controller key exactly on the beat to play the note, and request the sequence position at this time with GetPlayingSegmentInfo,
the values returned are ahead of the beat (150ms, 1150ms, 1250ms, ...).
So, the notes are considered as not played/played too late, which is very problematic for a musical game.
Note : I'm also a musician, and I also requested some team members to test the app, so I'm sure the problem is real, and not because the note have really been played to late ;)
Basically, here is what i'm doing :
1) I post my music event, with AkCallbackType.AK_EnableGetMusicPlayPosition flag to enable GetPlayingSegmentInfo feature
2) On unity Update, I check Input.GetKeyDown()
3) If input key is down, I recover the current segment position using GetPlayingSegmentInfo and then AkSegmentInfo.iCurrentPosition
4) I compare this position to the expected music notes position, and every time, the returned position is ahead with and offset of approximatively 150ms (while I press the right note at the right time...)
Is anybody already having experiencing this issue ?
If somebody would have a solution (even a clue), I would really appreciate, because I have done a lot of test, trying to oversimplify the code, and I still don't understand why this problem occurs.
Note : I can provide a very simple test project if you want ;)
Many thanks in advance for your help.