Table of Contents
This plug-in allows sound designers to use audio from an external source, for example a network stream, or a microphone connected to the PC or console.
Aside from regular plug-in initialization (see Integration Details - Plug-Ins), integrating the Audio Input plugin requires the game to provide input audio data used by the various instances of the plug-in in the Wwise project. This is done through a callback mechanism, as exposed in AkAudioInputSourceFactory.h:
- First, the game calls SetAudioInputCallbacks() to set the mandatory AkAudioInputPluginExecuteCallbackFunc which will be called whenever an instance of audio input requires more audio data. If the audio data is not a mono stream of 32-bit floating point values, the AkAudioInputPluginGetFormatCallbackFunc also needs to be set. Note that the AkAudioInputPluginGetFormatCallbackFunc callback only accepts interleaved 16-bit or non-interleaved 32-bit audio data.
- Then, the game calls PostEvent to start the audio input plug-in.
- The Sound Engine will call AkAudioInputPluginGetFormatCallbackFunc once at the beginning of playback, then AkAudioInputPluginExecuteCallbackFunc at each audio frame until the plug-in finishes execution (either through a stop action or the execute callback setting AK_NoMoreData on io_pBufferOut->eState).
A very simple integration is demonstrated in the Microphone/AudioInput demo, using a microphone as the input. In the Integration Demo Wwise Project, a Sound Voice named Microphone uses the Audio Input plug-in as a source.
||Note: In Wwise, the audio input plugin is fed with audio from the microphone input of the PC. If no microphone is connected, it will be silent.|