Version

menu_open
Wwise SDK 2021.1.14
Audio Input Source Plug-in

About this plug-in

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.

Integrating the plug-in

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:

  • At 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 must be set. This callback only accepts audio data in the following formats, where the left and right channels are stored as shown for a 16-frame buffer:

      • interleaved 16-bit integer (also known as planar)
      • non-interleaved 32-bit floating point

      AkAudioInputPluginGetFormatCallbackFunc uses AkAudioFormat which can be populated as shown in the example below: AkAudioFormat consists of audio data format specifications and channel configuration AkChannelConfig.

      AkChannelConfig can be set with the help of one of the calls mentioned below: AkChannelConfig.SetAnonymous(...), AkChannelConfig.SetStandard(...) or AkChannelConfig.SetAmbisonic(...)

      ChannelMask: There are no restrictions on channelmask. Standard and custom channelmasks are supported.

AkAudioFormat audioFormat;
AkChannelConfig audioChConfig;
audioChConfig.SetStandard(0);
audioFormat.SetAll(
48000, // Sample rate
audioChConfig, // \ref AkChannelConfig
16, // Bits per samples
2, // 2 bytes per samples
AK_INT, // feeding integers(signed)
);

A very simple integration is demonstrated in the Microphone/AudioInput Demo 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.
AkForceInline void SetStandard(AkUInt32 in_uChannelMask)
Set channel config as a standard configuration specified with given channel mask.
Definition: AkSpeakerConfig.h:565
const AkDataTypeID AK_INT
Integer data type (uchar, short, and so on)
Definition: AkCommonDefs.h:50
Defines the parameters of an audio buffer format.
Definition: AkCommonDefs.h:63
const AkDataInterleaveID AK_INTERLEAVED
Interleaved data.
Definition: AkCommonDefs.h:53
void SetAll(AkUInt32 in_uSampleRate, AkChannelConfig in_channelConfig, AkUInt32 in_uBitsPerSample, AkUInt32 in_uBlockAlign, AkUInt32 in_uTypeID, AkUInt32 in_uInterleaveID)
Definition: AkCommonDefs.h:126

Cette page a-t-elle été utile ?

Besoin d'aide ?

Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !

Visitez notre page d'Aide

Décrivez-nous de votre projet. Nous sommes là pour vous aider.

Enregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !

Partir du bon pied avec Wwise