版本

menu_open
警告:系统已根据您所用大版本 (2022.1.17.8543) 自动跳转至最新文档。若想访问特定版本的文档,请从 Audiokinetic Launcher 下载离线文档,并在 Wwise 设计程序中勾选 Offline Documentation 选项。
Wwise SDK 2022.1.17
使用 Speaker Matrix Callback 定制高级混音

某些游戏对信号通路和声像平移有非常特殊的要求,而 Wwise 中可能无法满足这些要求。解决此限制的一种方法是注册到“Speaker Matrix Callback”(扬声器矩阵回调)。当 voice(声部)或总线将混入到另一条总线时,将调用此回调。通过此回调,您可以更改全局的和声道专用的声部或总线电平,从而修改混音或声像平移。

下面示例显示您可以如何为声部注册到此回调。注册是在发送播放此声部的事件时完成的。

VoiceCallback 回调描述如何识别输出总线,更改声部混入输出总线时的基础音量,以及更改声像平移音量来模拟不同的入射角。AkSpeakerVolumeMatrixCallbackInfo::pContext 暴露出声部相关信息,而 AkSpeakerVolumeMatrixCallbackInfo::pMixerContext 暴露出声部混入的总线相关信息(干信号的输出总线或辅助发送)。

以下示例显示如何注册到总线回调。在本例中,AkSpeakerVolumeMatrixCallbackInfo::pContext 暴露出总线相关信息,我们要将("My_Bus")注册到这条总线,而 AkSpeakerVolumeMatrixCallbackInfo::pMixerContext 也对总线的父总线(或信号链中的下一条混音总线)暴露出总线相关信息,该总线是要将信号混音进去的总线。

下一示例显示如何注册到总线以查询它的电平表数据。

AK::IAkMixerInputContext * pContext
Context of the current voice/bus about to be mixed into the output bus with specified base volume and...
Definition: AkCallback.h:169
AkGameObjectID gameObjID
Game object ID
Definition: AkCallback.h:87
virtual AkReal32 GetSpread(AkUInt32 in_uIndex)=0
AkReal32 * pfBaseVolume
Base volume, common to all channels.
Definition: AkCallback.h:167
@ AK_EnableBusMeter_KPower
Enable computation of K-weighted power metering (used as a basis for computing loudness,...
Definition: AkTypes.h:1213
AkChannelConfig outputConfig
Channel configuration of the output bus.
Definition: AkCallback.h:166
AKSOUNDENGINE_API AKRESULT RegisterBusVolumeCallback(AkUniqueID in_busID, AkBusCallbackFunc in_pfnCallback, void *in_pCookie=NULL)
AkUInt32 uNumChannels
Number of channels.
AkChannelConfig inputConfig
Channel configuration of the voice/bus.
Definition: AkCallback.h:165
AkUInt64 AkGameObjectID
Game object ID
Definition: AkTypes.h:128
const AkVector & OrientationFront() const
Get orientation front vector.
Definition: AkTypes.h:607
const AkVector & OrientationTop() const
Get orientation top vector.
Definition: AkTypes.h:613
AkUInt32 uChannelMask
Channel mask (configuration).
AkMeteringFlags
Metering flags. Used for specifying bus metering, through AK::SoundEngine::RegisterBusVolumeCallback(...
Definition: AkTypes.h:1207
AkForceInline AkUInt32 GetRequiredSize(AkUInt32 in_uNumChannelsIn, AkUInt32 in_uNumChannelsOut)
Compute size (in bytes) required for given channel configurations.
AK::IAkMixerPluginContext * pMixerContext
Output mixing bus context. Use it to access a few useful panning and mixing services,...
Definition: AkCallback.h:170
AkCallbackType
Type of callback. Used as a bitfield in methods AK::SoundEngine::PostEvent() and AK::SoundEngine::Dyn...
Definition: AkCallback.h:48
float AkReal32
32-bit floating point
virtual AKRESULT GetGameObjectPosition(AkUInt32 in_uIndex, AkSoundPosition &out_position) const =0
AkUniqueID eventID
Unique ID of Event, passed to PostEvent()
Definition: AkCallback.h:97
virtual IAkVoicePluginInfo * GetVoiceInfo()=0
AkReal32 * VectorPtr
Volume vector. Access each element with the standard bracket [] operator.
AkReal32 Y
Y Position
Definition: AkTypes.h:468
AkUInt32 AkUniqueID
Unique 32-bit ID
Definition: AkTypes.h:120
virtual AkReal32 GetFocus(AkUInt32 in_uIndex)=0
AkReal32 X
X Position
Definition: AkTypes.h:467
AkForceInline VectorPtr GetChannel(MatrixPtr in_pVolumeMx, AkUInt32 in_uIdxChannelIn, AkUInt32 in_uNumChannelsOut)
Get pointer to volume distribution for input channel in_uIdxChannelIn.
@ AK_EnableBusMeter_TruePeak
Enable computation of true peak metering (most CPU and memory intensive).
Definition: AkTypes.h:1210
#define AK_SPEAKER_SETUP_3STEREO
3.0 setup channel mask
virtual AkUInt32 GetNum3DPositions()=0
#define AKASSERT(Condition)
Definition: AkAssert.h:67
#define AkAlloca(_size_)
Stack allocations.
AkReal32 Z
Z Position
Definition: AkTypes.h:469
void SetOrientation(const AkVector &in_orientationFront, const AkVector &in_orientationTop)
Set orientation. Orientation front and top should be orthogonal and normalized.
Definition: AkTypes.h:679
AKSOUNDENGINE_API AKRESULT RegisterBusMeteringCallback(AkUniqueID in_busID, AkBusMeteringCallbackFunc in_pfnCallback, AkMeteringFlags in_eMeteringFlags, void *in_pCookie=NULL)
AkReal32 * pfEmitterListenerVolume
Emitter-listener pair-specific gain. When there are multiple emitter-listener pairs,...
Definition: AkCallback.h:168
virtual AKRESULT Compute3DPositioning(AkReal32 in_fAngle, AkReal32 in_fElevation, AkReal32 in_fSpread, AkReal32 in_fFocus, AkChannelConfig in_inputConfig, AkChannelMask in_uInputChanSel, AkChannelConfig in_outputConfig, AkReal32 in_fCenterPerc, AK::SpeakerVolumes::MatrixPtr out_mxVolumes)=0
Struct containing metering information about a buffer. Depending on when this struct is generated,...
Definition: AkCommonDefs.h:203
static const AkPlayingID AK_INVALID_PLAYING_ID
Invalid playing ID
Definition: AkTypes.h:165
virtual AKRESULT ComputeSpeakerVolumesDirect(AkChannelConfig in_inputConfig, AkChannelConfig in_outputConfig, AkReal32 in_fCenterPerc, AK::SpeakerVolumes::MatrixPtr out_mxVolumes)=0
AKSOUNDENGINE_API AkUInt32 GetIDFromString(const char *in_pszString)
virtual IAkGameObjectPluginInfo * GetGameObjectInfo()=0
AkForceInline void SetStandard(AkUInt32 in_uChannelMask)
Set channel config as a standard configuration specified with given channel mask.
AkReal32 * MatrixPtr
Volume matrix. Access each input channel vector with AK::SpeakerVolumes::Matrix::GetChannel().
virtual AkReal32 GetCenterPerc()=0
uint32_t AkUInt32
Unsigned 32-bit integer
Game object information available to plugins.
Definition: IAkPlugin.h:100
3D vector for some operations in 3D space. Typically intended only for localized calculations due to ...
Definition: AkTypes.h:425
AKSOUNDENGINE_API AkPlayingID PostEvent(AkUniqueID in_eventID, AkGameObjectID in_gameObjectID, AkUInt32 in_uFlags=0, AkCallbackFunc in_pfnCallback=NULL, void *in_pCookie=NULL, AkUInt32 in_cExternals=0, AkExternalSourceInfo *in_pExternalSources=NULL, AkPlayingID in_PlayingID=AK_INVALID_PLAYING_ID)
@ AK_SpeakerVolumeMatrix
Callback triggered at each frame, letting the client modify the speaker volume matrix....
Definition: AkCallback.h:54
AK::SpeakerVolumes::MatrixPtr pVolumes
Pointer to volume matrix describing the contribution of each source channel to destination channels....
Definition: AkCallback.h:164
Position and orientation of objects in a "local" space
Definition: AkTypes.h:594
AkUInt32 AkPlayingID
Playing ID
Definition: AkTypes.h:123
AkPlayingID playingID
Playing ID of Event, returned by PostEvent()
Definition: AkCallback.h:96
const AkReal32 * ConstVectorPtr
Constant volume vector. Access each element with the standard bracket [] operator.

此页面对您是否有帮助?

需要技术支持?

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

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

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

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

开始 Wwise 之旅