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. Contact Sales if your project requires a support plan.

Using AkAudioInput in Unity

+2 votes
I am on a Mac in Unity and Wwise 2017.2 and cannot resolve a "Wwise: Plug-in execution failure" when using the wwise AkAudioInput source plugin. I have looked at the unity integration documentation on using the AkAudioInput source plugin and it only says iOs audio input is not supported -- nothing else.  It does *not* say any other systems are unsupported.  The documentation offers no path forward.  What am I doing wrong?  I can plainly hear the sound in wwise.
asked Jan 20 in General Discussion by Kristina W. (490 points)

1 Answer

+1 vote

I would just like to say that I solved it and made a script to copy/paste on my project blog.  The reason I don't post it here is because my script is larger than the character limit. 

Here is the summary from my comments in the script:

"// Basic strategy is to call UnityEngine.Microphone.Start(), which begins periodic calls to OnAudioFilterRead in the Unity DSP audio processing thread (producer thread)
// and then to call AkAudioInputManager.PostAudioInputEvent(), which begins periodic calls to AudioSamplesDelegate in an AkAudioInputManager background thread (consumer thread)

// Microphone input samples are written to a buffer in OnAudioFilterRead (producer function)
// and read from the buffer in AudioSamplesDelegate (consumer function)

// IMPORTANT:  ensure that under Edit > Project Settings > Audio, Disable Unity Audio is NOT checked"

Here: https://vraasp.wordpress.com/2018/01/24/getting-real-time-microphone-input-into-wwise-in-unity-using-the-ak-audio-input-plugin-script/

 

answered Jan 24 by Kristina W. (490 points)
Really excited to try this, if it works for me then I owe you one!
It will work but make sure your sample rates/audio settings are set up right (you will get the hypnotoad and/or a delay if you put a different sample rate) and be very deliberate with your routing/ ducking in the audiomixer!    Comment back to me if you run into any issues.  I can vouch for it working atm.  I'm using it right now.
...