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

0 votes

I'm attempting to get MIDI Event callbacks using Wwise 2022.1.0.8070 Unity 2022.2.0f1 and building for Android, however it appears as though the data that is returned in AkMIDIEventCallbackInfo is wrong.

When testing this on desktop (mac) or iOS or for android within the editor, I get the correct values for AkMIDIEventCallbackInfo.byType (for example AkMIDIEventTypes.NOTE_ON with a value of 144), but on a debug or productions build of Android this only appears to return a value of 218 (which is not any of the types in the enum AkMIDIEventTypes).

Here is a small snippet of c# code that works perfectly on desktop and iOS, but is not working on Android:

private void Start() {
    uint flags = (uint)AkCallbackType.AK_MIDIEvent;
    MIDIMusicEvent.Post(gameObject, flags, OnMusicCallback);
}

private void OnMusicCallback(object inCookie, AkCallbackType inType, AkCallbackInfo inInfo) {
    if(inType != AkCallbackType.AK_MIDIEvent) {
        return;
    }

    AkMIDIEventCallbackInfo info = (AkMIDIEventCallbackInfo)inInfo;

    Debug.Log(info.byType); // returns AkMIDIEventTypes.NOTE_ON and other types on desktop and iOS, but only returns 218 on Android
    Debug.Log(info.byOnOffNote); // returns the correct note number on desktop and iOS, but android only returns value of 28
    Debug.Log(info.byChan); // returns the correct channel on desktop and iOS, but android only returns a value of 209
}

Any ideas on how to proceed? Is there something I'm missing here? I'd like to get accurate data in the MIDI callbacks on Android.

in General Discussion by Jon L. (100 points)

Please sign-in or register to answer this question.

...