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.

How to Pass Arbitrary Data from Wwise Plug-in to Unity

+1 vote
We are planning to write a custom plug-in to analyze and segment microphone recordings during gameplay. We would like the send a custom data structure containing our analysis data (length of note, frequency, etc.) from the Wwise plug-in to Unity for visualization. What is the best approach for this? Thank you!
asked Jun 21, 2017 in General Discussion by Ryan M. (120 points)

1 Answer

+2 votes

I do not know if it is the best approach, but at least it has worked for us. We implemented a custom plug-in, which calculates the spectrogram of currently playing audio files. This data we then visualize in Unity (basically this is provided by GetSpectrogramData() in Unity, but we could not use it anymore after switching to WWise ).

 To get the data out of the plugin and into Unity, we used DLLImport to integrate  the WWise plugin dll directly into a monobehavoir script. Then you need two exported functions in the dll. First submit (basically a memory pointer) your custom data array to the dll and second to read out updated data regularly (in our case each frame in Update()). If you do not already know, have a look on how to integrate native plugins(your wwise plugin is native) into unity and how to "marshall" data from c# to c(++).

Hope this helps! 

answered Jun 30, 2017 by Dominic P. (270 points)
Good idea - I was wondering if it was possible to great a single dll that is both a Wwise plug-in and Unity plug-in. Seems it is possible - will give it a try, thanks!
...