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.

Get Marker Label from AkMarkerCallbackInfo in Untity

0 votes
Hello,

I already tried around a bit, but i just cant get it to work.

this is my code and I have a wwise event with a marker. My goal is to put out the name of the marker in the callback function. How can I achieve that ?
    public void WwiseDialogue()
    {
        dialogue.Post(gameObject, (uint)AkCallbackType.AK_Marker, WwiseLastDialogueEnd);
    }
    public void WwiseLastDialogueEnd(object in_cookie, AkCallbackType in_type, object in_info)
    {
    }
asked Feb 2 in General Discussion by jonas k. (150 points)

1 Answer

+1 vote

Hey Jonas, 

So what you could do is typecast the in_info to AkMarkerCallbackInfo. Try this: 

public void WwiseDialogue() {
    dialogue.Post(gameObject, (uint)AkCallbackType.AK_Marker, WwiseLastDialogueEnd);
}

public void WwiseLastDialogueEnd(object in_cookie, AkCallbackType in_type, object in_info) {
    if (in_type == AkCallbackType.AK_Marker) {
        AkMarkerCallbackInfo info = (AkMarkerCallbackInfo)in_info;
        print(info.strLabel); // This prints the marker name          
    }
}

Let us know if that's what you need.

answered Feb 3 by Mads Maretty S. (Audiokinetic) (7,310 points)
Yes exactly, thanks a lot :)
...