I am creating a sink plugin that needs custom data.
I have a simple console application with the following code to send some custom data:
/* Preceding initialisation*/
MyCustomDataStruct myCustomData;
const auto result = AK::SoundEngine::SendPluginCustomGameData(
AK::BUSSES::MY_BUS,
AK_INVALID_GAME_OBJECT,
AkPluginTypeSink,
MY_COMPANY_ID,
MY_PLUGIN_ID,
&myCustomData,
sizeof(MyCustomDataStruct));
In my plugin MyAudioDeviceSink is derived from AK::IAkSinkPlugin:
void MyAudioDeviceSink::Consume(AkAudioBuffer* inputBuffer, AkRamp gain)
{
void* myCustomData = nullptr;
AkUInt32 size = 0;
context->GetPluginCustomGameData(myCustomData, size);
/* rest of function */
}
SendPluginCustomGameData returns AK_Success, but I am finding that myCustomData is always null in my plugin. I must be missing something obvious but I can't see what I am doing wrong. Any suggestions? Is there 'custom data' example anywhere?