版本
menu_open
Wwise SDK 2023.1.2
音频输入源插件

关于此插件

此插件可让声音设计师使用来自外部源(例如网络流媒体或连接到 PC 或游戏机的话筒)的音频。

集成插件

除正常的插件初始化(请参见 集成详情——插件 ),集成音频输入插件需要游戏提供 Wwise 工程中各种插件所使用的输入音频数据。这通过 AkAudioInputSourceFactory.h 中暴露的回调机制来执行:

  • 首先,游戏调用 SetAudioInputCallbacks() 来设置必需的 AkAudioInputPluginExecuteCallbackFunc ,每当音频输入端需要更多音频数据时都会调用此函数。
    • 若音频数据不是 32 位浮点值的单声道播放流,则须设置 AkAudioInputPluginGetFormatCallbackFunc 。此回调仅接受以下格式的音频数据(16 帧缓冲区按如下所示存储左右声道):

      • 交错式 16 位整数(也叫 2D 整数
      • 非交错式 32 位浮点数

      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 可通过以下所述调用进行设置: AkChannelConfig.SetAnonymous(...)、AkChannelConfig.SetStandard(...) 或 AkChannelConfig.SetAmbisonic(...)

      ChannelMask:对 channelmask 没有限制。支持标准和自定义 channelmask。

      Interleaved format (AK_INTERLEAVED) only supports AK_INT, and non-interleaved format (AK_NONINTERLEAVED) only supports AK_FLOAT.

AkAudioFormat audioFormat;
AkChannelConfig audioChConfig;
audioChConfig.SetStandard(0);
audioFormat.SetAll(
48000, // 采样率
audioChConfig, // \ref AkChannelConfig
16, // 位/样本
2, // 2 字节/样本
AK_INT, // 馈送整数(有符号)
);

Microphone/AudioInput Demo 演示中演示了一个非常简单的集成操作,它使用话筒作为输入设备。在 Integration Demo Wwise 工程中,被命名为 Microphone 的 Sound Voice(语音)使用音频输入插件作为来源。

备注: 在 Wwise 中,音频输入插件收到来自 PC 话筒输入的音频。如果没有连接话筒,则不会出声。
AkForceInline void SetStandard(AkUInt32 in_uChannelMask)
Set channel config as a standard configuration specified with given channel mask.
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

此页面对您是否有帮助?

需要技术支持?

仍有疑问?或者问题?需要更多信息?欢迎联系我们,我们可以提供帮助!

查看我们的“技术支持”页面

介绍一下自己的项目。我们会竭力为您提供帮助。

来注册自己的项目,我们帮您快速入门,不带任何附加条件!

开始 Wwise 之旅