版本
menu

Wwise SDK 2025.1.2
IAkPlugin.h
浏览该文件的文档.
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Copyright (c) 2025 Audiokinetic Inc.
25 *******************************************************************************/
26 
27 /// \file
28 /// Software source plug-in and effect plug-in interfaces.
29 
30 #ifndef _IAK_PLUGIN_H_
31 #define _IAK_PLUGIN_H_
32 
39 #include <AK/Tools/Common/AkLock.h>
42 #include <AK/Tools/Common/AkRng.h>
49 #include <AK/AkWwiseSDKVersion.h>
50 
51 #include <math.h>
52 
53 #if defined AK_CPU_X86 || defined AK_CPU_X86_64 || defined (AK_CPU_WASM)
54 #include <xmmintrin.h>
55 #endif
56 
57 /// Plug-in information structure.
58 /// \remarks The bIsInPlace field is only relevant for effect plug-ins.
59 /// \sa
60 /// - \ref iakeffect_geteffectinfo
62 {
63  /// Constructor for default values
66  , uBuildVersion( 0 )
67  , bIsInPlace(true)
68  , bCanChangeRate(false)
69  , bReserved(false)
70  , bCanProcessObjects(false)
71  , bIsDeviceEffect(false)
72  , bCanRunOnObjectConfig(true)
73  , bUsesGainAttribute(false)
74  {}
75 
76  AkPluginType eType; ///< Plug-in type
77  AkUInt32 uBuildVersion; ///< Plug-in build version, must match the AK_WWISESDK_VERSION_COMBINED macro from AkWwiseSDKVersion.h. Prevents usage of plugins compiled for other versions, avoiding crashes or data issues.
78  bool bIsInPlace; ///< Buffer usage (in-place or not). If true, and the plug-in is an insert effect, it should implement IAkInPlaceEffectPlugin, otherwise it should implement IAkOutOfPlaceEffectPlugin. If it is an object processor (see CanProcessObjects, below), it should implement IAkInPlaceObjectPlugin or IAkOutOfPlaceObjectPlugin respectively.
79  bool bCanChangeRate; ///< True for effects whose sample throughput is different between input and output. Effects that can change rate need to be out-of-place (!bIsInPlace), and cannot exist on busses.
80  bool bReserved; ///< Legacy bIsAsynchronous plug-in flag, now unused. Preserved for plug-in backward compatibility. bReserved should be false for all plug-in.
81  bool bCanProcessObjects; ///< Plug-in can process audio objects. They must implement IAkInPlaceObjectPlugin or IAkOutOfPlaceObjectPlugin, depending on if they work in-place or out-of-place. Out-of-place object processors only work on busses.
82  bool bIsDeviceEffect; ///< Plug-in can process final mixes and objects right before sending them to the audio device for output. Plug-ins that process the main mix, passthrough mix and objects directly at the end of the pipeline must implement IAkAudioDeviceEffectPlugin. Audio device effect plug-ins must be in place (bIsInPlace = true) and must be able to process objects (bCanProcessObjects = true).
83  bool bCanRunOnObjectConfig; ///< Plug-in can run on bus with Audio Object configuration. Effect plug-ins are instantiated once per Audio Objects on those busses. While this may be fine for effects such as EQs, it is an user error for effects such as reverbs, or for any effect that is non-linear. Effects that return false will fail to initialize when created on busses with Audio Object Configuration.
84  bool bUsesGainAttribute; ///< Plug-in knows how to process objects separately from the cumulativeGain of the object (or the processing of the object's audio is independent of the overall object gain). bCanProcessObjects must also be true, as this relies on Object Metadata.
85 };
86 
87 //Forward declarations.
88 namespace AK
89 {
90  class PluginRegistration;
91 }
93 
94 struct AkAcousticTexture;
95 struct AkAudioObject;
96 struct AkAudioObjects;
97 
98 namespace AK
99 {
100  class IAkStreamMgr;
101  class IAkGlobalPluginContext;
102 
103  /// Game object information available to plugins.
105  {
106  protected:
107  /// Virtual destructor on interface to avoid warnings.
109 
110  public:
111 
112  /// Get the ID of the game object.
113  virtual AkGameObjectID GetGameObjectID() const = 0;
114 
115  /// Retrieve the number of emitter-listener pairs (rays) of the game object.
116  /// A game object may have more than one position, and be listened to more than one listener.
117  /// The returned value is the product of these two numbers. Use the returned value as a higher
118  /// bound for the index of GetEmitterListenerPair().
119  /// Note that rays whose listener is irrelevant to the current context are ignored. For example,
120  /// if the calling plug-in exists on a bus, only listeners that are routed to the end point's
121  /// device are considered.
122  /// \sa
123  /// - AK::SoundEngine::SetPosition()
124  /// - AK::SoundEngine::SetMultiplePositions()
125  /// - AK::SoundEngine::SetListeners()
126  /// - AK::IAkGameObjectPluginInfo::GetEmitterListenerPair()
128 
129  /// Retrieve the emitter-listener pair (ray) of the game object at index in_uIndex.
130  /// Call GetNumEmitterListenerPairs() prior to this function to get the total number of
131  /// emitter-listener pairs of the game object.
132  /// The emitter-listener pair is expressed as the game object's position relative to the
133  /// listener, in spherical coordinates.
134  /// \note
135  /// - The distance takes game object and listener scaling factors into account.
136  /// - Returned distance and angles are those of the game object, and do not necessarily correspond
137  /// to any sound's positioning data.
138  /// \return AK_Fail if the index is invalid, AK_Success otherwise.
139  /// \sa
140  /// - AK::SoundEngine::SetScalingFactor()
141  /// - AK::IAkGameObjectPluginInfo::GetNumEmitterListenerPairs()
143  AkUInt32 in_uIndex, ///< Index of the pair, [0, GetNumEmitterListenerPairs()[
144  AkEmitterListenerPair & out_emitterListenerPair ///< Returned relative source position in spherical coordinates.
145  ) const = 0;
146 
147  /// Get the number of positions of the game object. Use this value to determine the indices to be
148  /// passed to GetGameObjectPosition().
149  /// \sa
150  /// - AK::SoundEngine::SetPosition()
151  /// - AK::SoundEngine::SetMultiplePositions()
152  /// - AK::IAkGameObjectPluginInfo::GetGameObjectPosition();
153  virtual AkUInt32 GetNumGameObjectPositions() const = 0;
154 
155  /// Get the raw position of the game object at index in_uIndex.
156  /// Use GetNumGameObjectPositions() prior to this function to get the total number of positions
157  /// of that game object.
158  /// \return AK_Fail if the index is out of bounds, AK_Success otherwise.
159  /// \sa
160  /// - AK::SoundEngine::SetPosition()
161  /// - AK::SoundEngine::SetMultiplePositions()
162  /// - AK::IAkGameObjectPluginInfo::GetNumGameObjectPositions()
164  AkUInt32 in_uIndex, ///< Index of the position, [0, GetNumGameObjectPositions()[
165  AkSoundPosition & out_position ///< Returned raw position info.
166  ) const = 0;
167 
168  /// Get the multi-position type assigned to the game object.
169  /// \return AkMultiPositionType_MultiSources when the effect is instantiated on a bus.
170  /// \sa
171  /// - AK::SoundEngine::SetPosition()
172  /// - AK::SoundEngine::SetMultiplePositions()
174 
175  /// Get the distance scaling factor of the associated game object.
176  /// \sa
177  /// - AK::SoundEngine::SetScalingFactor()
178  virtual AkReal32 GetGameObjectScaling() const = 0;
179 
180  /// Get the game object IDs of listener game objects that are listening to the emitter game object.
181  /// Note that only listeners relevant to the current context are considered. For example,
182  /// if the calling plug-in exists on a bus, only listeners that are routed to the end point's
183  /// device are added to the returned array.
184  /// \return True if the call succeeded, false if all the listeners could not fit into the array,
185  /// \sa
186  /// - AK::SoundEngine::SetListeners()
187  virtual bool GetListeners(
188  AkGameObjectID* out_aListenerIDs, ///< Array of listener IDs to fill, or NULL to query the size needed.
189  AkUInt32& io_uSize ///< In: max size of the array, out: number of valid elements returned in out_aListenerIDs.
190  ) const = 0;
191 
192  /// Get information about a listener. Use GetListeners() prior to this function
193  /// in order to know which listeners are listening to the associated game object.
194  /// \return AK_Fail if the listener ID is invalid. AK_Success otherwise.
195  /// \sa
196  /// - AK::SoundEngine::SetListeners()
197  /// - AK::IAkGameObjectPluginInfo::GetListeners()
199  AkGameObjectID in_uListener, ///< Bit field identifying the listener for which you desire information.
200  AkListener & out_listener ///< Returned listener info.
201  ) const = 0;
202 
203  /// Get the position of a distance probe associated with the given listener.
204  /// Use GetListeners() prior to this function
205  /// in order to know which listeners are listening to the associated game object.
206  /// Returns AK_Success if a distance probe is associated with the specified listener.
207  /// If no distance probe game object is associated with the specified listener,
208  /// or the listener is not valid, AK_Fail is returned.
209  /// - AK::SoundEngine::SetDistanceProbe()
210  /// - AK::SoundEngine::SetListeners()
211  /// - AK::IAkGameObjectPluginInfo::GetListeners()
213  AkGameObjectID in_uListener, ///< Listener Game Object
214  AkWorldTransform& out_position ///< Returned raw position info.
215  ) const = 0;
216  };
217 
218  /// Voice-specific information available to plug-ins.
220  {
221  protected:
222  /// Virtual destructor on interface to avoid warnings.
224 
225  public:
226 
227  /// Retrieve the Playing ID of the event corresponding to this voice (if applicable).
228  virtual AkPlayingID GetPlayingID() const = 0;
229 
230  /// Get priority value associated to this voice. When priority voice is modified by distance, the minimum distance among emitter-listener pairs is used.
231  /// \return The priority between AK_MIN_PRIORITY and AK_MAX_PRIORITY inclusively.
232  virtual AkPriority GetPriority() const = 0;
233  };
234 
235  /// Interface to retrieve contextual information available to all types of plugins.
237  {
238  protected:
239  /// Virtual destructor on interface to avoid warnings.
241 
242  public:
243 
244  /// \return The global sound engine context.
245  /// \sa IAkGlobalPluginContext
246  virtual IAkGlobalPluginContext* GlobalContext() const = 0;
247 
248  /// Obtain the interface to access the game object on which the plugin is instantiated.
249  /// \return The interface to GameObject info, nullptr if undefined.
251 
252  /// Identify the output device into which the data processed by this plugin will end up.
253  /// Applicable to plug-ins instantiated as bus effects and to sink plugins.
254  /// Plug-ins instantiated in the Containers hierarchy (i.e. on voices) return AK_NotCompatible.
255  /// \sa integrating_secondary_outputs
256  /// \return The device type and unique identifier. AK_Success if successful, AK_NotCompatible otherwise.
258  AkUInt32 & out_uOutputID, ///< Device identifier, when multiple devices of the same type are possible.
259  AkPluginID & out_uDevicePlugin ///< Device plugin ID.
260  ) const = 0;
261 
262  /// Return the pointer and size of the plug-in media corresponding to the specified index.
263  /// The pointer returned will be NULL if the plug-in media is either not loaded or inexistant.
264  /// When this function is called and returns a valid data pointer, the data can only be used by this
265  /// instance of the plugin and is guaranteed to be valid only during the plug-in lifespan.
266  virtual void GetPluginMedia(
267  AkUInt32 in_dataIndex, ///< Index of the plug-in media to be returned.
268  AkUInt8* &out_rpData, ///< Pointer to the data
269  AkUInt32 &out_rDataSize ///< size of the data returned in bytes.
270  ) = 0;
271 
272  /// Return the pointer and size of the game data corresponding to the specified index, sent by the game using AK::SoundEngine::SendPluginCustomGameData().
273  /// The pointer returned will be NULL if the game data is inexistent.
274  /// When this function is called and returns a valid data pointer, the data can only be used by this
275  /// instance of the plugin and is guaranteed to be valid only during the frame.
276  virtual void GetPluginCustomGameData(
277  void* &out_rpData, ///< Pointer to the data
278  AkUInt32 &out_rDataSize ///< size of the data returned in bytes.
279  ) = 0;
280 
281  /// Post a custom blob of data to the UI counterpart of this plug-in.
282  /// Data is sent asynchronously through the profiling system.
283  /// Notes:
284  /// - You may call CanPostMonitorData() to determine if your plug-in can send data to the UI.
285  /// - Data is copied into the communication buffer within this method,
286  /// so you may discard it afterwards.
287  /// - Sending data to the UI is only possible in Debug and Profile. Thus, you should
288  /// enclose your calls to package and send that data within !AK_OPTIMIZED preprocessor flag.
289  /// \return AK_Success if the plug-in exists on a bus, AK_Fail otherwise.
291  void * in_pData, ///< Blob of data.
292  AkUInt32 in_uDataSize ///< Size of data.
293  ) = 0;
294 
295  /// Query the context to know if it is possible to send data to the UI counterpart of this plug-in.
296  /// \return True if the authoring tool is connected and monitoring the game, false otherwise.
297  /// \sa PostMonitorData()
298  virtual bool CanPostMonitorData() = 0;
299 
300  /// Post a monitoring message or error string. This will be displayed in the Wwise capture
301  /// log.
302  /// \return AK_Success if successful, AK_Fail if there was a problem posting the message.
303  /// In optimized mode, this function returns AK_NotCompatible.
304  /// \remark This function is provided as a tracking tool only. It does nothing if it is
305  /// called in the optimized/release configuration and return AK_NotCompatible.
307  const char* in_pszError, ///< Message or error string to be displayed
308  AK::Monitor::ErrorLevel in_eErrorLevel ///< Specifies whether it should be displayed as a message or an error
309  ) = 0;
310 
311  /// Get the cumulative gain of all mixing stages, from the host audio node down to the device end point.
312  /// Returns 1.f when the node is a Property Container (voice), because a voice may be routed to several mix chains.
313  /// \return The cumulative downstream gain.
315 
316  /// Return the channel configuration of the parent node that this plug-in will mix into. GetParentChannelConfig() may be used to set the output configuration of an
317  /// out-of-place effect to avoid additional up/down mixing stages. Please note however that it is possible for out-of-place effects later in the chain to change
318  /// this configuration.
319  /// Returns not out_channelConfig.IsValid() when the node is a Property Container (voice), because a voice may be routed to several mix chains.
320  /// \return AK_Success if the channel config of the primary, direct parent bus could be determined, AK_Fail otherwise.
322  AkChannelConfig& out_channelConfig ///< Channel configuration of parent node (downstream bus).
323  ) const = 0;
324 
325  /// Return an interface to query processor specific features.
327 
328  /// Get internal ID of hosting sound structure (Property Container or bus).
329  /// In the case of a voice, the ID is internal but corresponds to what you would get from the duration
330  /// callback (see AkDurationCallbackInfo::audioNodeID). In the case of a bus, it can be matched with the bus name converted
331  /// to a unique ID using AK::SoundEngine::GetIDFromString().
332  /// In the case if an audio device (sink), it is AK_INVALID_UNIQUE_ID.
333  /// \return ID of input.
334  /// \sa
335  /// - AkDurationCallbackInfo
336  /// - AK::SoundEngine::PostEvent()
337  /// - AK::SoundEngine::GetIDFromString()
338  virtual AkUniqueID GetAudioNodeID() const = 0;
339 
340  /// Get the expected input of the audio device (sink) at the end of the bus pipeline from the caller's perspective.
341  ///
342  /// \deprecated This API call is deprecated in favor of \c GetOutputDeviceInfo.
344  AkChannelConfig& out_sinkConfig, // The channel config of the sink; if set to "Objects", then the sink is in 3D audio mode. Any other config means 3D audio is not active.
345  Ak3DAudioSinkCapabilities& out_3dAudioCaps // When out_sinkConfig is set to Objects, inspect this struct to learn which 3D audio features are supported by the sink
346  ) const = 0;
347 
348  /// Retrieve information about the output (audio) device that the caller is routed to.
349  ///
350  /// When called from a plug-in placed on a bus, the bus hierarchy is traversed upward until the master bus is reached. The audio device connected to this master bus is then queried.
351  /// When called from a source plug-in, the source's output bus is the starting point of the traversal.
352  /// When called from an audio device or audio device effect plug-in, that audio device is queried.
353  ///
354  /// \akwarning During Init, the plug-in may not be connected to the pipeline yet. In this case, \c AK_DeviceNotFound is returned and device information will be zero'ed out.
355  /// To ensure valid information is retrieved, call this API during Execute.
356  /// \endakwarning
357  ///
358  /// \return
359  /// - AK_Success: Device information is populated
360  /// - AK_DeviceNotFound: The plugin attached to the specified context is not routed to an output device yet.
362  AkOutputDeviceInfo& out_outputDeviceInfo ///< Information about the output device.
363  ) const = 0;
364  };
365 
366  /// Interface to retrieve contextual information for an effect plug-in.
367  /// \sa
368  /// - \ref iakmonadiceffect_init
370  {
371  protected:
372  /// Virtual destructor on interface to avoid warnings.
374 
375  public:
376 
377  /// Determine whether the effect is to be used in Send Mode or not.
378  /// Effects used in auxiliary busses are always used in Send Mode.
379  /// \return True if the effect is in Send Mode, False otherwise
380  virtual bool IsSendModeEffect() const = 0;
381 
382  /// Obtain the interface to access the voice in which the plugin is inserted.
383  /// \return The interface to voice info. NULL if the plugin is instantiated on a bus.
385 
386  /// Obtain the interface to access services available on busses.
387  /// \return The interface to mixing context if the plugin is instantiated on a bus. NULL if it is instantiated on a voice.
389 
390  /// \name For object processors:
391  /// Output object management.
392  //@{
393 
394  /// Create new objects on the output side. Only out-of-place object processors (plugins implementing AK::IAkOutOfPlaceObjectPlugin) may create output objects.
395  /// If successful, the newly constructed objects will be available in out_ppBuffer/out_ppObjects.
396  /// To obtain all the output objects in a single array after having created objects using this function, use GetOutputObjects, or wait for the next call to AK::IAkOutOfPlaceObjectPlugin::Execute
397  /// where output objects are passed via the in_pObjectBuffersOut/in_pObjectsOut arguments.
398  /// Object processors inform the host that an output object may be disposed of by setting its state to AK_NoMoreData from within AK::IAkOutOfPlaceObjectPlugin::Execute.
399  /// \aknote You should never store the pointers returned by out_ppBuffer/out_ppObjects, as the location of pointed objects may change at each frame, or after subsequent calls to CreateOutputObjects.\endaknote
400  /// \return AK_Success if all objects were created successfully, AK_Fail otherwise.
401  /// The optional arguments out_ppBuffer and out_ppObjects may be used to obtain the output objects newly created.
402  /// \sa
403  /// - GetOutputObjects
404  /// - AK::IAkOutOfPlaceObjectPlugin::Execute
406  AkChannelConfig in_channelConfig, ///< Desired channel configuration for all new objects.
407  AkAudioObjects& io_objects ///< AkAudioObjects::uNumObjects, the number of objects to create.
408  ///< AkAudioObjects::ppObjectBuffers, Returned array of pointers to the object buffers newly created, allocated by the caller. Pass nullptr if they're not needed.
409  ///< AkAudioObjects::ppObjects, Returned array of pointers to the objects newly created, allocated by the caller. Pass nullptr if they're not needed.
410  ) = 0;
411 
412  /// Access the output objects. This function is helpful when CreateOutputObjects is called from within AK::IAkOutOfPlaceObjectPlugin::Execute.
413  /// You need to allocate the array of pointers. You may initially obtain the number of objects that will be returned by calling this function with io_numObjects = 0.
414  /// \aknote You should never store the pointers returned by GetOutputObjects, as the location of pointed objects may change at each frame, or after calls to CreateOutputObjects.\endaknote
415  virtual void GetOutputObjects(
416  AkAudioObjects& io_objects ///< AkAudioObjects::uNumObjects, The number of objects. If 0 is passed, io_objects::numObjects returns with the total number of objects.
417  ///< AkAudioObjects::ppObjectBuffers, Returned array of pointers to object buffers, allocated by the caller. The number of objects is the smallest between io_numObjects and the total number of objects.
418  ///< AkAudioObjects::ppObjects, Returned array of pointers to objects, allocated by the caller. The number of objects is the smallest between io_numObjects and the total number of objects.
419  ) = 0;
420 
421  //@}
422 
423 
424  /// \name For effects:
425  /// Sidechain mix management.
426  //@{
427 
428  // Fetches the current channel config set for the specified sidechain, writing the contents to the address.
429  // Note that this channel config may change at runtime due to live-editing of the sidechain mix, or changes to the primary output device, so it should be regularly refreshed
430  // Returns AK_Success if in_uSidechainId is registered, or AK_IDNotFound otherwise.
431  virtual AKRESULT GetSidechainMixChannelConfig(AkUniqueID in_uSidechainId, AkChannelConfig* out_pChannelCfg) = 0;
432 
433  // Accumulates the provided audio buffer to the target sidechain, with the provided scope of in_uSidechainScopeId.
434  // If the sidechain is not registered, returns AK_IDNotFound.
435  // If the audioBuffer's channel config does not match the sidechain's channelconfig, or the audioBuffer's maxFrames does not match the soundengine granularity, returns AK_InvalidParameter.
436  // May return AK_InsufficientMemory if sufficient memory for the sidechain is not available.
437  virtual AKRESULT SendToSidechainMix(AkUniqueID in_uSidechainId, AkUInt64 in_uSidechainScopeId, AkAudioBuffer* in_pAudioBuffer) = 0;
438 
439  // Copies the mixed result of the sidechain, with the matching in_uSidechainScopeId, from the previous soundengine tick into the provided audio buffer.
440  // The provided io_pAudioBuffer must:
441  // - have a matching channel config as the sidechain, as defined by IAkEffectPluginContext::GetSidechainMixChannelConfig
442  // - have the correct value for MaxFrames, as defined by IAkGlobalPluginContext::GetMaxBufferLength,
443  // - have pre-allocated space for the audio buffer, to copy the sidechain audio data into
444  // The ValidFrames on the audio buffer will be updated to match the MaxFrames if the copy of sidechain data completes successfully.
445  //
446  // \return AK_UnsupportedChannelConfig if io_pAudioBuffer's channel config does not match the sidechain mix
447  // \return AK_InvalidParameter if io_pAudioBuffer's maxFrames does not match the sidechain mix
448  // \return AK_IDNotFound if the sidechain is not registered, or the combination of in_uSidechainId and in_uSidechainScopeId did not occur on the previous tick
449  virtual AKRESULT ReceiveFromSidechainMix(AkUniqueID in_uSidechainId, AkUInt64 in_uSidechainScopeId, AkAudioBuffer* io_pAudioBuffer) = 0;
450 
451  //@}
452 
453  };
454 
455  /// Interface to retrieve contextual information for a source plug-in.
456  /// \sa
457  /// - \ref iaksourceeffect_init
459  {
460  protected:
461  /// Virtual destructor on interface to avoid warnings.
463 
464  public:
465 
466  /// Retrieve the number of loops the source should produce.
467  /// \return The number of loop iterations the source should produce (0 if infinite looping)
468  virtual AkUInt16 GetNumLoops() const = 0;
469 
470  /// Obtain the interface to access the voice in which the plugin is inserted.
471  /// \return The interface to voice info.
473 
474  /// Obtain the MIDI event info associated to the source.
475  /// \return The MIDI event info.
476  ///
477  virtual AkMIDIEvent GetMidiEvent() const = 0;
478 
479  /// Retrieve Cookie information for a Source Plugin
480  /// \return the void pointer of the Cookie passed to the PostEvent
481  virtual void* GetCookie() const = 0;
482  };
483 
484  /// Interface to retrieve contextual information for a mixer.
486  {
487  protected:
488  /// Virtual destructor on interface to avoid warnings.
490 
491  public:
492 
493  /// DEPRECATED.
494  /// Get the type of the bus on which the mixer plugin is instantiated.
495  /// AkBusHierachyFlags is a bit field, indicating whether the bus is the master (top-level) bus or not,
496  /// and whether it is in the primary or secondary mixing graph.
497  /// \return The bus type.
498  virtual AkUInt32 GetBusType() = 0;
499 
500  /// Get speaker angles of the specified device.
501  /// The speaker angles are expressed as an array of loudspeaker pairs, in degrees, relative to azimuth ]0,180].
502  /// Supported loudspeaker setups are always symmetric; the center speaker is always in the middle and thus not specified by angles.
503  /// Angles must be set in ascending order.
504  /// You may call this function with io_pfSpeakerAngles set to NULL to get the expected number of angle values in io_uNumAngles,
505  /// in order to allocate your array correctly. You may also obtain this number by calling
506  /// AK::GetNumberOfAnglesForConfig( AK_SPEAKER_SETUP_DEFAULT_PLANE ).
507  /// If io_pfSpeakerAngles is not NULL, the array is filled with up to io_uNumAngles.
508  /// Typical usage:
509  /// - AkUInt32 uNumAngles;
510  /// - GetSpeakerAngles( NULL, uNumAngles );
511  /// - AkReal32 * pfSpeakerAngles = AkAlloca( uNumAngles * sizeof(AkReal32) );
512  /// - GetSpeakerAngles( pfSpeakerAngles, uNumAngles );
513  /// \warning Call this function only after the sound engine has been properly initialized.
514  /// \return AK_Success if the end point device is properly initialized, AK_Fail otherwise.
515  /// \sa AK::SoundEngine::GetSpeakerAngles()
517  AkReal32 * io_pfSpeakerAngles, ///< Returned array of loudspeaker pair angles, in degrees relative to azimuth [0,180]. Pass NULL to get the required size of the array.
518  AkUInt32 & io_uNumAngles, ///< Returned number of angles in io_pfSpeakerAngles, which is the minimum between the value that you pass in, and the number of angles corresponding to the output configuration, or just the latter if io_pfSpeakerAngles is NULL.
519  AkReal32 & out_fHeightAngle ///< Elevation of the height layer, in degrees relative to the plane.
520  ) = 0;
521 
522  /// \name Services.
523  //@{
524 
525  /// Compute a direct speaker assignment volume matrix with proper downmixing rules between two channel configurations.
526  /// You may use the returned volume matrix with IAkGlobalPluginContext::MixNinNChannels.
527  /// \aknote ComputePositioning is more general than this one, as it can also compute speaker gains for non-3D spatialization, and should be favored.\endaknote
528  /// \return AK_Success if successful, AK_Fail otherwise.
529  /// \sa IAkGlobalPluginContext
531  AkChannelConfig in_inputConfig, ///< Channel configuration of the input.
532  AkChannelConfig in_outputConfig, ///< Channel configuration of the mixer output.
533  AkReal32 in_fCenterPerc, ///< Center percentage. Only applies to mono inputs with standard output configurations that have a center channel.
534  AK::SpeakerVolumes::MatrixPtr out_mxVolumes ///< Returned volumes matrix. Must be preallocated using AK::SpeakerVolumes::Matrix::GetRequiredSize() (see AK::SpeakerVolumes::Matrix services).
535  ) = 0;
536 
537  /// Compute a volume matrix given the position of the panner (Wwise 2D panner).
538  /// You may use the returned volume matrix with IAkGlobalPluginContext::MixNinNChannels.
539  /// \aknote ComputePositioning is more general than this one, as it can also compute speaker gains for 3D spatialization, and should be favored.\endaknote
540  /// \return AK_Success if successful, AK_Fail otherwise.
541  /// \sa IAkGlobalPluginContext
543  AkSpeakerPanningType in_ePannerType, ///< Panner type
544  const AkVector & in_position, ///< x,y,z panner position [-1,1]. Note that z has no effect at the moment.
545  AkReal32 in_fCenterPct, ///< Center percentage.
546  AkChannelConfig in_inputConfig, ///< Channel configuration of the input.
547  AkChannelConfig in_outputConfig, ///< Channel configuration of the mixer output.
548  AK::SpeakerVolumes::MatrixPtr out_mxVolumes ///< Returned volumes matrix. Must be preallocated using AK::SpeakerVolumes::Matrix::GetRequiredSize() (see AK::SpeakerVolumes::Matrix services).
549  ) = 0;
550 
551  /// Compute panning gains on the plane given an incidence angle and channel configuration.
552  /// You may use the returned volume matrix with IAkGlobalPluginContext::MixNinNChannels.
553  /// \aknote ComputePositioning is more general than this one, as it can also compute speaker gains for non-3D spatialization, and should be favored.\endaknote
554  /// \return AK_Success if successful, AK_Fail otherwise.
555  /// \sa IAkGlobalPluginContext
557  AkReal32 in_fAngle, ///< Incident angle, in radians [-pi,pi], where 0 is the azimuth (positive values are clockwise)
558  AkChannelConfig in_outputConfig, ///< Desired output configuration.
559  AkReal32 in_fCenterPerc, ///< Center percentage. Only applies to mono inputs to outputs that have no center.
560  AK::SpeakerVolumes::VectorPtr out_vVolumes ///< Returned volumes (see AK::SpeakerVolumes::Vector services). Must be allocated prior to calling this function with the size returned by AK::SpeakerVolumes::Vector::GetRequiredSize() for the desired configuration.
561  ) = 0;
562 
563  /// Initialize spherical VBAP
564  /// \return AK_Success if successful, AK_Fail otherwise.
566  AK::IAkPluginMemAlloc* in_pAllocator, ///< Memory allocator
567  const AkSphericalCoord* in_SphericalPositions, ///< Array of points in spherical coordinates, containing the position of each channel.
568  const AkUInt32 in_NbPoints, ///< Number of points in the position array
569  void *& out_pPannerData ///< Contains data relevant to the 3D panner that shoud be re-used accross plugin instances.
570  ) = 0;
571 
572  /// Compute panning gains on the plane given an incidence angle and channel configuration.
573  /// \aknote ComputePositioning is more general than this one, as it handles spread and focus, and can also compute speaker gains for non-3D spatialization, and should be favored.\endaknote
574  /// \return AK_Success if successful, AK_Fail otherwise.
576  void* in_pPannerData, ///< Contains data relevant to the 3D panner that shoud be re-used accross plugin instances.
577  AkReal32 in_fAzimuth, ///< Incident angle, in radians [-pi,pi], where 0 is the azimuth (positive values are clockwise)
578  AkReal32 in_fElevation, ///< Incident angle, in radians [0,pi], where 0 is the elevation (positive values are clockwise)
579  AkUInt32 in_uNumChannels, ///< Number of output channels.
580  AK::SpeakerVolumes::VectorPtr out_vVolumes ///< Returned volumes (see AK::SpeakerVolumes::Vector services). Must be allocated prior to calling this function with the size returned by AK::SpeakerVolumes::Vector::GetRequiredSize() for the desired configuration.
581  ) = 0;
582 
583  /// Clear panner data obtained from InitSphericalVBAP().
584  /// \return AK_Success if successful, AK_Fail otherwise.
586  AK::IAkPluginMemAlloc* in_pAllocator, ///< Memory allocator
587  void* in_pPannerData ///< Contains data relevant to the 3D panner that shoud be re-used accross plugin instances.
588  ) = 0;
589 
590  /// Compute standard 3D positioning.
591  /// You may use the returned volume matrix with IAkGlobalPluginContext::MixNinNChannels.
592  /// \aknote The cartesian counterpart of Compute3DPositioning, that uses emitter and listener transforms, should be used instead of this function.
593  /// It is more complete and more efficient. \endaknote
594  /// \aknote ComputePositioning is more general than this one, as it can also compute speaker gains for non-3D spatialization, and should be favored.\endaknote
595  /// \return AK_Success if successful, AK_Fail otherwise.
596  /// \sa IAkGlobalPluginContext
598  AkReal32 in_fAngle, ///< Incident angle, in radians [-pi,pi], where 0 is the azimuth (positive values are clockwise).
599  AkReal32 in_fElevation, ///< Incident elevation angle, in radians [-pi/2,pi/2], where 0 is the horizon (positive values are above the horizon).
600  AkReal32 in_fSpread, ///< Spread ([0,1]).
601  AkReal32 in_fFocus, ///< Focus ([0,1]).
602  AkChannelConfig in_inputConfig, ///< Channel configuration of the input.
603  AkChannelMask in_uInputChanSel, ///< Mask of input channels selected for panning (excluded input channels don't contribute to the output).
604  AkChannelConfig in_outputConfig, ///< Desired output configuration.
605  AkReal32 in_fCenterPerc, ///< Center percentage. Only applies to mono inputs to outputs that have a center.
606  AK::SpeakerVolumes::MatrixPtr out_mxVolumes ///< Returned volumes matrix. Must be preallocated using AK::SpeakerVolumes::Matrix::GetRequiredSize() (see AK::SpeakerVolumes::Matrix services).
607  ) = 0;
608 
609  /// Compute standard 3D positioning.
610  /// You may use the returned volume matrix with IAkGlobalPluginContext::MixNinNChannels.
611  /// \aknote This function is more complete and more efficient than the Compute3DPositioning service that uses spherical coordinates, and should be favored.\endaknote
612  /// \aknote ComputePositioning is more general than this one, as it can also compute speaker gains for non-3D spatialization, and should be favored.\endaknote
613  /// \return AK_Success if successful, AK_Fail otherwise.
614  /// \sa IAkGlobalPluginContext
616  const AkWorldTransform & in_emitter, ///< Emitter transform.
617  const AkWorldTransform & in_listener, ///< Listener transform.
618  AkReal32 in_fCenterPerc, ///< Center percentage. Only applies to mono inputs to outputs that have a center.
619  AkReal32 in_fSpread, ///< Spread ([0,1]).
620  AkReal32 in_fFocus, ///< Focus ([0,1]).
621  AkChannelConfig in_inputConfig, ///< Channel configuration of the input.
622  AkChannelMask in_uInputChanSel, ///< Mask of input channels selected for panning (excluded input channels don't contribute to the output).
623  AkChannelConfig in_outputConfig, ///< Desired output configuration.
624  AK::SpeakerVolumes::MatrixPtr out_mxVolumes ///< Returned volumes matrix. Must be preallocated using AK::SpeakerVolumes::Matrix::GetRequiredSize() (see AK::SpeakerVolumes::Matrix services).
625  ) = 0;
626 
627  /// Compute the speaker volume matrix of built-in positioning in Wwise from given positioning data and input and output channel configurations.
628  /// You may use the returned volume matrix with IAkGlobalPluginContext::MixNinNChannels.
629  /// Any known (non-anonymous) combination of configurations will work. For example, ambisonics will be decoded or encoded if needed.
630  /// Additionally, anonymous configurations registered via RegisterAnonymousConfig are partially supported as output channel configurations.
631  /// \aknote The function will fail if the input or output configuration is object-based, as the speaker volume matrix would be undefined.\endaknote
632  /// All panning or spatialization types are honored.
633  /// 3D Spatialization is performed relative to the default listener position (0,0,0) and orientation, where the front vector is (0,0,1) and the top vector is (0,1,0), left handed.
634  /// \return AK_Success if succeeded, AK_InvalidParameter if the input or output configuration is object-based, or AK_Fail if the channel configurations are unknown or unhandled.
635  /// \sa IAkGlobalPluginContext
636  /// \sa IAkMixerPluginContext::RegisterAnonymousConfig
638  const AkPositioningData& in_posData, ///< Positioning data. The field "threeD" is ignored if in_posData.behavioral.spatMode is AK_SpatializationMode_None.
639  AkChannelConfig in_inputConfig, ///< Channel configuration of the input.
640  AkChannelConfig in_outputConfig, ///< Channel configuration of the output.
641  AK::SpeakerVolumes::MatrixPtr out_mxVolumes ///< Returned volumes matrix. Must be preallocated using AK::SpeakerVolumes::Matrix::GetRequiredSize() (see AK::SpeakerVolumes::Matrix services).
642  ) = 0;
643 
644 
645  //@}
646 
647  /// \name Metering.
648  //@{
649 
650  /// Set flags for controlling computation of metering values on the mix buffer.
651  /// Pass AK_NoMetering to disable metering.
652  /// \sa
653  /// - AK::AkMetering
654  virtual void EnableMetering( AkMeteringFlags in_eFlags ) = 0;
655 
656  //@}
657 
658  /// Register an anonymous configuration for use with ComputePositioning. This enables use of arbitrary
659  /// speaker configurations with 3d panning and ambisonics decoding. Some positioning features are not
660  /// supported with anonymous configurations: this includes center%, height spread, balance-fade, and
661  /// steering. An UnregisterAnonymousConfig call for each registered configuration should be made before
662  /// termination of the plug-in. Calling RegisterAnonymousConfig multiple times with the same number of
663  /// channels will result in the last coordinates taking precedence.
664  /// \sa IAkMixerPluginContext::UnregisterAnonymousConfig
665  /// \sa IAkMixerPluginContext::ComputePositioning
667  AkUInt32 in_uNumChannels, ///< Number of channels of the anonymous configuration being registered.
668  const AkSphericalCoord* in_SphericalPositions ///< Array of points in spherical coordinates, containing the position of each channel.
669  ) = 0;
670 
671  /// Unregister an anonymous configuration previously registered with RegisterAnonymousConfig.
672  /// \sa IAkMixerPluginContext::RegisterAnonymousConfig
673  /// \sa IAkMixerPluginContext::ComputePositioning
675  AkUInt32 in_uNumChannels ///< Number of channels of the anonymous configuration being unregistered.
676  ) = 0;
677  };
678 
679  /// Parameter node interface, managing access to an enclosed parameter structure.
680  /// \aknote The implementer of this interface should also expose a static creation function
681  /// that will return a new parameter node instance when required (see \ref se_plugins_overview). \endaknote
682  /// \sa
683  /// - \ref shared_parameter_interface
685  {
686  protected:
687  /// Virtual destructor on interface to avoid warnings.
688  virtual ~IAkPluginParam(){}
689 
690  public:
691  /// Create a duplicate of the parameter node instance in its current state.
692  /// \aknote The allocation of the new parameter node should be done through the AK_PLUGIN_NEW() macro. \endaknote
693  /// \return Pointer to a duplicated plug-in parameter node interface
694  /// \sa
695  /// - \ref iakeffectparam_clone
697  IAkPluginMemAlloc * in_pAllocator ///< Interface to memory allocator to be used
698  ) = 0;
699 
700  /// Initialize the plug-in parameter node interface.
701  /// Initializes the internal parameter structure to default values or with the provided parameter
702  /// block if it is valid. \endaknote
703  /// \aknote If the provided parameter block is valid, use SetParamsBlock() to set all parameters at once. \endaknote
704  /// \return Possible return values are: AK_Success, AK_Fail, AK_InvalidParameter
705  /// \sa
706  /// - \ref iakeffectparam_init
707  virtual AKRESULT Init(
708  IAkPluginMemAlloc * in_pAllocator, ///< Interface to the memory allocator to be used
709  const void * in_pParamsBlock, ///< Pointer to a parameter structure block
710  AkUInt32 in_uBlockSize ///< Size of the parameter structure block
711  ) = 0;
712 
713  /// Called by the sound engine when a parameter node is terminated.
714  /// \aknote The self-destruction of the parameter node must be done using the AK_PLUGIN_DELETE() macro. \endaknote
715  /// \return AK_Success if successful, AK_Fail otherwise
716  /// \sa
717  /// - \ref iakeffectparam_term
718  virtual AKRESULT Term(
719  IAkPluginMemAlloc * in_pAllocator ///< Interface to memory allocator to be used
720  ) = 0;
721 
722  /// Set all plug-in parameters at once using a parameter block.
723  /// \return AK_Success if successful, AK_InvalidParameter otherwise
724  /// \sa
725  /// - \ref iakeffectparam_setparamsblock
727  const void *in_pParamsBlock, ///< Pointer to a parameter structure block
728  AkUInt32 in_uBlockSize ///< Size of the parameter structure block
729  ) = 0;
730 
731  /// Update a single parameter at a time and perform the necessary actions on the parameter changes.
732  /// \aknote The parameter ID corresponds to the AudioEnginePropertyID in the plug-in XML description file. \endaknote
733  /// \return AK_Success if successful, AK_InvalidParameter otherwise
734  /// \sa
735  /// - \ref iakeffectparam_setparam
737  AkPluginParamID in_paramID, ///< ID number of the parameter to set
738  const void * in_pValue, ///< Pointer to the value of the parameter to set
739  AkUInt32 in_uParamSize ///< Size of the value of the parameter to set
740  ) = 0;
741 
742  /// Use this constant with AK::Wwise::IPluginPropertySet::NotifyInternalDataChanged,
743  /// AK::Wwise::IAudioPlugin::GetPluginData and IAkPluginParam::SetParam. This tells
744  /// that the whole plugin data needs to be saved/transferred.
745  ///\sa
746  /// - AK::Wwise::IPluginPropertySet::NotifyInternalDataChanged
747  /// - AK::Wwise::IAudioPlugin::GetPluginData
748  /// - AK::IAkPluginParam::SetParam
749  static const AkPluginParamID ALL_PLUGIN_DATA_ID = 0x7FFF;
750  };
751 
752  /// Wwise sound engine plug-in interface. Shared functionality across different plug-in types.
753  /// \aknote The implementer of this interface should also expose a static creation function
754  /// that will return a new plug-in instance when required (see \ref soundengine_plugins). \endaknote
755  class IAkPlugin
756  {
757  protected:
758  /// Virtual destructor on interface to avoid warnings.
759  virtual ~IAkPlugin(){}
760 
761  public:
762  /// Release the resources upon termination of the plug-in.
763  /// \return AK_Success if successful, AK_Fail otherwise
764  /// \aknote The self-destruction of the plug-in must be done using AK_PLUGIN_DELETE() macro. \endaknote
765  /// \sa
766  /// - \ref iakeffect_term
767  virtual AKRESULT Term(
768  IAkPluginMemAlloc * in_pAllocator ///< Interface to memory allocator to be used by the plug-in
769  ) = 0;
770 
771  /// The reset action should perform any actions required to reinitialize the state of the plug-in
772  /// to its original state (e.g. after Init() or on effect bypass).
773  /// \return AK_Success if successful, AK_Fail otherwise.
774  /// \sa
775  /// - \ref iakeffect_reset
776  virtual AKRESULT Reset() = 0;
777 
778  /// Plug-in information query mechanism used when the sound engine requires information
779  /// about the plug-in to determine its behavior.
780  /// \warning This function can be called before Init. Implementation of this function should not rely on internal state initialized in Init.
781  /// \return AK_Success if successful.
782  /// \sa
783  /// - \ref iakeffect_geteffectinfo
785  AkPluginInfo & out_rPluginInfo ///< Reference to the plug-in information structure to be retrieved
786  ) = 0;
787 
788  /// Some plug-ins are accessing Media from the Wwise sound bank system.
789  /// If the IAkPlugin object is not using media, this function will not be used and should simply return false.
790  /// If the IAkPlugin object is using media, the RelocateMedia feature can be optionally implemented.
791  /// To implement correctly the feature, the plugin must be able to "Hot swap" from a memory location to another one in a single blocking call (AK::IAkPlugin::RelocateMedia)
792  ///
793  /// \sa
794  /// - AK::IAkPlugin::RelocateMedia
795  virtual bool SupportMediaRelocation() const
796  {
797  return false;
798  }
799 
800  /// Some plug-ins are accessing Media from the Wwise sound bank system.
801  /// If the IAkPlugin object is not using media, this function will not be used.
802  /// If the IAkPlugin object is using media, the RelocateMedia feature can be optionally implemented.
803  /// When this function is being called, the IAkPlugin object must make the required changes to remove all
804  /// referenced from the old memory pointer (previously obtained by GetPluginMedia() (and offsets to) to not access anymore the content of the old memory data and start using the newly provided pointer instead.
805  /// The change must be done within the function RelocateMedia().
806  /// After this call, the memory space in in_pOldInMemoryData will be invalidated and cannot be used safely anymore.
807  ///
808  /// This function will not be called if SupportMediaRelocation returned false.
809  ///
810  /// \sa
811  /// - AK::IAkPlugin::SupportMediaRelocation
813  AkUInt8* /*in_pNewMedia*/,
814  AkUInt8* /*in_pOldMedia*/
815  )
816  {
817  return AK_NotImplemented;
818  }
819 
820  };
821 
822  /// Software effect plug-in interface (see \ref soundengine_plugins_effects).
823  class IAkEffectPlugin : public IAkPlugin
824  {
825  protected:
826  /// Virtual destructor on interface to avoid warnings.
827  virtual ~IAkEffectPlugin(){}
828 
829  public:
830  /// Software effect plug-in initialization. Prepares the effect for data processing, allocates memory and sets up the initial conditions.
831  /// \aknote Memory allocation should be done through appropriate macros (see \ref fx_memory_alloc). \endaknote
832  /// \sa
833  /// - \ref iakmonadiceffect_init
834  virtual AKRESULT Init(
835  IAkPluginMemAlloc * in_pAllocator, ///< Interface to memory allocator to be used by the effect
836  IAkEffectPluginContext * in_pEffectPluginContext, ///< Interface to effect plug-in's context
837  IAkPluginParam * in_pParams, ///< Interface to plug-in parameters
838  AkAudioFormat & io_rFormat ///< Audio data format of the input/output signal. Only an out-of-place plugin is allowed to change the channel configuration. Object processors may receive a channel configuration with type "object" if attached to a bus configured for Audio Objects processing, but otherwise may receive a config for just 1 source. Out-of-place object processors may change the format type, in which case the host bus will automatically create an output object with the desired channel configuration.
839  ) = 0;
840  };
841 
842  /// Software effect plug-in interface for in-place processing (see \ref soundengine_plugins_effects).
844  {
845  public:
846  /// Software effect plug-in DSP execution for in-place processing.
847  /// \aknote The effect should process all the input data (uValidFrames) as long as AK_DataReady is passed in the eState field.
848  /// When the input is finished (AK_NoMoreData), the effect can output more sample than uValidFrames up to MaxFrames() if desired.
849  /// All sample frames beyond uValidFrames are not initialized and it is the responsibility of the effect to do so when outputting an effect tail.
850  /// The effect must notify the pipeline by updating uValidFrames if more frames are produced during the effect tail.
851  /// \aknote The effect will stop being called by the pipeline when AK_NoMoreData is returned in the the eState field of the AkAudioBuffer structure.
852  /// See \ref iakmonadiceffect_execute_general.
853  virtual void Execute(
854  AkAudioBuffer * io_pBuffer ///< In/Out audio buffer data structure (in-place processing)
855  ) = 0;
856 
857  /// Skips execution of some frames, when the voice is virtual playing from elapsed time.
858  /// This can be used to simulate processing that would have taken place (e.g. update internal state).
859  /// Return AK_DataReady or AK_NoMoreData, depending if there would be audio output or not at that point.
861  AkUInt32 in_uFrames ///< Number of frames the audio processing should advance.
862  ) = 0;
863  };
864 
865 
866  /// Software effect plug-in interface for out-of-place processing (see \ref soundengine_plugins_effects).
868  {
869  public:
870  /// Software effect plug-in for out-of-place processing.
871  /// \aknote An input buffer is provided and will be passed back to Execute() (with an advancing offset based on uValidFrames consumption by the plug-in).
872  /// The output buffer should be filled entirely by the effect (at which point it can report AK_DataReady) except on last execution where AK_NoMoreData should be used.
873  /// AK_DataNeeded should be used when more input data is necessary to continue processing.
874  /// \aknote Only the output buffer eState field is looked at by the pipeline to determine the effect state.
875  /// See \ref iakmonadiceffect_execute_outofplace.
876  virtual void Execute(
877  AkAudioBuffer * in_pBuffer, ///< Input audio buffer data structure
878  AkUInt32 in_uInOffset, ///< Offset position into input buffer data
879  AkAudioBuffer * out_pBuffer ///< Output audio buffer data structure
880  ) = 0;
881 
882  /// Skips execution of some frames, when the voice is virtual playing from elapsed time.
883  /// This can be used to simulate processing that would have taken place (e.g. update internal state).
884  /// Return AK_DataReady or AK_NoMoreData, depending if there would be audio output or not at that point.
886  AkUInt32 &io_uFrames ///< Number of frames the audio processing should advance. The output value should be the number of frames that would be consumed to output the number of frames this parameter has at the input of the function.
887  ) = 0;
888  };
889 
890  /// In-place Object Processor plug-in interface. Implement this interface when your plugin returns both AkPluginInfo::bCanProcessObjects
891  /// and AkPluginInfo::bIsInPlace set to true.
892  /// In-place object processors just modify objects' audio or metadata, but do not destroy objects create additional output objects.
893  /// An object processor may be initialized with an Object configuration, or any channel configuration, depending on the configuration of its input.
894  /// It is not allowed to change the channel configuration in Init.
896  {
897  public:
898 
899  /// In-place object processor plug-in DSP execution.
900  /// \aknote The effect should process all the input data (uValidFrames) of each input object in in_pObjectsIn as long as AK_DataReady is passed in their corresponding eState field.
901  /// When an input object is finished (eState is AK_NoMoreData), the effect can output more samples than uValidFrames, up to MaxFrames() if desired.
902  /// The effect must notify the pipeline by updating uValidFrames of a given object if more frames are produced, and by setting its eState to AK_DataReady as long as more samples will be produced.\endaknote.
903  /// \sa AK::IAkEffectPlugin::Init.
904  virtual void Execute(
905  const AkAudioObjects& io_objects ///< Input/Output objects and object buffers.
906  ) = 0;
907  };
908 
909  /// Out-of-place Object Processor plug-in interface. Implement this interface when your plugin returns AkPluginInfo::bCanProcessObjects set to true
910  /// and AkPluginInfo::bIsInPlace set to false.
911  /// With out-of-place object processors, the set of output objects is different than that of the input objects. Out-of-place object processors typically create
912  /// their own output objects using IAkEffectPluginContext::CreateObject. Alternatively, an output object is created by the host bus if the channel configuration
913  /// returned from Init is not of type AK_ChannelConfigType_Objects.
914  /// Only out-of-place object processors may create output objects or change the output channel configuration.
916  {
917  public:
918 
919  /// Out-of-place object processor plug-in DSP execution.
920  /// \aknote When running out-of-place, the effect must only update uValidFrames and eState fields of output objects.
921  /// When the object processor sets an output object's eState field to AK_NoMoreData, the host will garbage collect them afterwards. \endaknote
922  /// \akwarning If an out-of-place object processor calls AK::IAkEffectPluginContext::CreateOutputObjects from within Execute, it must not access the output objects passed in out_objects, as the pointed objects may have moved elsewhere in memory.
923  /// In that case it must use AK::IAkEffectPluginContext::GetOutputObjects. Arguments in_pObjectBuffersOut and in_pObjectsOut can only be safely used if the plugin creates objects during Init, either via
924  /// AK::IAkEffectPluginContext::CreateOutputObjects, or by setting the channelConfig field of io_rFormat to a normal channel configuration (i.e. whose eConfigType is not AK_ChannelConfigType_Objects). \endakwarning
925  /// \sa AK::IAkEffectPlugin::Init.
926  virtual void Execute(
927  const AkAudioObjects& in_objects, ///< Input objects and object audio buffers.
928  const AkAudioObjects& out_objects ///< Output objects and object audio buffers.
929  ) = 0;
930  };
931 
933  {
934  public:
935  /// Compute the speaker volume matrix of built-in positioning in Wwise from given positioning data and input and output channel configurations.
936  /// Any known (non-anonymous) combination of configurations will work. For example, ambisonics will be decoded or encoded if needed.
937  /// \aknote The function will fail if the input or output configuration is object-based, as the speaker volume matrix would be undefined.\endaknote
938  /// All panning or spatialization types are honored.
939  /// 3D Spatialization is performed relative to the default listener position (0,0,0) and orientation, where the front vector is (0,0,1) and the top vector is (0,1,0), left handed.
940  /// \return AK_Success if succeeded, AK_InvalidParameter if the input or output configuration is object-based, or AK_Fail if the channel configurations are unknown or unhandled.
942  const AkPositioningData& in_posData, ///< Positioning data. The field "threeD" is ignored if in_posData.behavioral.spatMode is AK_SpatializationMode_None.
943  AkChannelConfig in_inputConfig, ///< Channel configuration of the input.
944  AkChannelConfig in_outputConfig, ///< Channel configuration of the output.
945  AK::SpeakerVolumes::MatrixPtr out_mxVolumes ///< Returned volumes matrix. Must be preallocated using AK::SpeakerVolumes::Matrix::GetRequiredSize() (see AK::SpeakerVolumes::Matrix services).
946  ) = 0;
947  };
948 
949  /// Audio device effect plug-in interface. Implement this interface for in-place effects that must be applied at the very end of the pipeline.
950  /// Audio device effects are applied right before sending audio buffers (main mix, passthrough and objects) to the audio device output through IAkSinkPlugin/IAk3DAudioSinkPlugin.
951  /// The format of the audio buffers passed to the effect matches the format requested by the sink plug-in. This means that audio device effects must be in-place; they cannot change io_rFormat in Init().
953  {
954  protected:
955  /// Virtual destructor on interface to avoid warnings.
957 
958  public:
959  /// Audio device effect plug-in initialization. Prepares the effect for data processing, allocates memory and sets up the initial conditions.
960  /// \aknote Memory allocation should be done through appropriate macros (see \ref fx_memory_alloc). \endaknote
961  virtual AKRESULT Init(
962  IAkPluginMemAlloc* in_pAllocator, ///< Interface to memory allocator to be used by the effect
963  IAkAudioDeviceEffectPluginContext* in_pEffectPluginContext, ///< Interface to audio effect's plug-in context
964  IAkPluginParam* in_pParams, ///< Interface to plug-in parameters
965  const AkAudioFormat& in_rFormat, ///< Audio data format of the input/output signal. Matches the channel configuration of the audio device sink plug-in. If format is object-based (AkChannelConfig::eConfigType is Ak_ChannelConfigType_Objects), the plug-in should verify Ak3DAudioSinkCapabilities to determine which inputs it can expect in Execute (main mix, passthrough, objects).
966  const Ak3DAudioSinkCapabilities& in_3dCapabilities ///< 3D capabilities of the output device sink plug-in. If io_rFormat is not object-based, this can be ignored and only the main mix will be submitted to Execute().
967  ) = 0;
968 
969  virtual void Execute(
970  AkAudioBuffer* io_pMainMix, ///< Audio buffer data structure for the main mix (binauralized or not, depending on if binauralization is supported and enabled).
971  AkAudioBuffer* io_pPassthroughMix, ///< The stereo mix to send out to the system in passthrough fashion (no binauralization). NULL if the channel configuration of the device is not object-based or does not have a passthrough.
972  const AkAudioObjects& io_objects, ///< 3D Audio objects and object audio buffers to be consumed. The audio buffers are in the native format of the sound engine (typically float, deinterleaved), as specified by io_rFormat passed to Init(). It is up to the plugin to transform it into a format that is compatible with its output.
973  AkRamp& io_gain ///< Volume gain to apply to all inputs. If the effect applies the gain, it must reset the gain to 1.0f so that it's not applied a second time in the sink plug-in.
974  ) = 0;
975  };
976 
977  /// Interface to retrieve information about an input of a mix connection (for processing during the SpeakerVolumeMatrix Callback)
979  {
980  public:
981  /// Obtain the interface to access the voice info of this input.
982  /// \return The interface to voice info. NULL when the input is not a voice but the output of another bus instead.
984 
985  /// Obtain the interface to access the game object on which the plugin is instantiated.
986  /// \return The interface to GameObject info.
988 
989  /// Query the nature of the connection between this input and the mixer.
990  /// \return The connection type (direct/dry, user-defined auxiliary send, game-defined auxiliary send). Bus inputs are always "direct".
992 
993  /// Use this method to retrieve user data to this context. It is always initialized to NULL until you decide to set it otherwise.
994  /// \return Attached user data.
995  /// \sa SetUserData()
996  virtual void* GetUserData() = 0;
997 
998  /// Use this method to attach user data to this context. It is always initialized to NULL until you decide to set it otherwise.
999  /// \sa GetUserData()
1000  virtual void SetUserData(void* in_pUserData) = 0;
1001 
1002  /// Retrieve center percentage of this input.
1003  /// \return Center percentage, between 0 and 1.
1004  virtual AkReal32 GetCenterPerc() = 0;
1005 
1006  /// Retrieve the speaker panning type: type of panning logic when object is not 3D spatialized.
1007  /// Note that the returned value is only relevant when the object is not 3D spatialized,
1008  /// that is Get3DSpatializationMode returns AK_SpatializationMode_None.
1009  /// \sa
1010  /// - Get3DSpatializationMode()
1012 
1013  /// Speaker panning:
1014  /// Retrieve the panner position (each vector component is between -1 and 1) of this input.
1015  /// Note that the returned value is only relevant when the object is not 3D spatialized,
1016  /// (Get3DSpatializationMode returns AK_SpatializationMode_None), and if speaker panning is not direct assignment
1017  /// (GetSpeakerPanningType does not return AK_DirectSpeakerAssignment).
1018  /// \sa
1019  /// - GetSpeakerPanningType()
1020  /// - Get3DSpatializationMode()
1021  virtual void GetPannerPosition(
1022  AkVector& out_position ///< Returned sound position.
1023  ) = 0;
1024 
1025  /// Get the value of this input's Listener Relative Routing option, that is, if the emitter-listener relative
1026  /// association is calculated at this node. Listener Relative Routing needs to be calculated in order for a node
1027  /// to be spatialized or attenuated with respect to in-game emitter and listener positions. Otherwise it can only
1028  /// be panned.
1029  /// \sa
1030  /// - Get3DSpatializationMode()
1031  /// - Get3DPositionType()
1032  /// - GetNum3DPositions()
1033  virtual bool HasListenerRelativeRouting() = 0;
1034 
1035  /// Get whether the emitter position is defined by the game alone (AK_3DPositionType_Emitter), or if it is further automated
1036  /// (AK_3DPositionType_EmitterWithAutomation, AK_3DPositionType_ListenerWithAutomation).
1037  /// The resulting 3D position(s) may be obtained by Get3DPosition(), and used for 3D spatialization or attenuation.
1038  /// \sa
1039  /// - Get3DPosition()
1040  /// - GetNum3DPositions()
1041  /// - HasListenerRelativeRouting()
1043 
1044  /// 3D spatialization:
1045  /// Retrieve the number of emitter-listener pairs (rays) of this input.
1046  /// Note that the returned value is always 0 unless the input has listener relative routing (see HasListenerRelativeRouting()).
1047  /// Use this function with Get3DPosition().
1048  /// \sa
1049  /// - Get3DPosition()
1050  /// - HasListenerRelativeRouting()
1052 
1053  /// 3D spatialization:
1054  /// Retrieve the spherical coordinates of the desired emitter-listener pair (ray) corresponding to this
1055  /// input, as automated by the engine. Applicable only when the input has listener relative routing (see HasListenerRelativeRouting()).
1056  /// Returned rays are those that result from engine automation, if applicable.
1057  /// \return AK_Success if the pair index is valid, AK_Fail otherwise.
1058  /// \sa
1059  /// - HasListenerRelativeRouting()
1060  /// - GetNum3DPositions()
1062  AkUInt32 in_uIndex, ///< Index of the pair, [0, GetNum3DPositions()[
1063  AkEmitterListenerPair& out_soundPosition ///< Returned sound position, in spherical coordinates.
1064  ) = 0;
1065 
1066  /// 3D spatialization:
1067  /// Evaluate spread value at the distance of the desired emitter-listener pair for this input.
1068  /// Applicable only when the input has listener relative routing (see HasListenerRelativeRouting()).
1069  /// \return The spread value, between 0 and 1. 0 if the pair index is invalid.
1070  /// \sa
1071  /// - HasListenerRelativeRouting()
1072  /// - GetNum3DPositions()
1073  /// - Get3DPosition()
1075  AkUInt32 in_uIndex ///< Index of the pair, [0, GetNum3DPositions()[
1076  ) = 0;
1077 
1078  /// 3D spatialization:
1079  /// Evaluate focus value at the distance of the desired emitter-listener pair for this input.
1080  /// Applicable only when the input has listener relative routing (see HasListenerRelativeRouting()).
1081  /// \return The focus value, between 0 and 1. 0 if the pair index is invalid.
1082  /// \sa
1083  /// - HasListenerRelativeRouting()
1084  /// - GetNum3DPositions()
1085  /// - Get3DPosition()
1087  AkUInt32 in_uIndex ///< Index of the pair, [0, GetNum3DPositions()[
1088  ) = 0;
1089 
1090  /// Get the max distance as defined in the attenuation editor.
1091  /// Applicable only when the input has listener relative routing (see HasListenerRelativeRouting()).
1092  /// \return True if this input has attenuation, false otherwise.
1094  AkReal32& out_fMaxAttenuationDistance ///< Returned max distance.
1095  ) = 0;
1096 
1097  /// Query the 3D spatialization mode used by this input.
1098  /// Applicable only when the input has listener relative routing (see HasListenerRelativeRouting()).
1099  /// \return The 3D spatialization mode (see Ak3DSpatializationMode). AK_SpatializationMode_None if not set, or if the input is not a node where the game object is evaluated against its listener.
1100  /// \sa
1101  /// - HasListenerRelativeRouting()
1103  };
1104 
1105  /// Interface to retrieve contextual information for a sink plugin.
1106  /// \sa
1107  /// - AK::IAkSinkPlugin
1109  {
1110  protected:
1111  /// Virtual destructor on interface to avoid warnings.
1113 
1114  public:
1115 
1116  /// Query if the sink plugin is instantiated on the main output device (primary tree).
1117  /// \return True if the sink plugin is instantiated on the main output device (primary tree), false otherwise.
1118  /// \sa
1119  /// - AK::IAkSinkPlugin::IsDataNeeded()
1120  /// - AK::IAkSinkPlugin::Consume()
1121  virtual bool IsPrimary() = 0;
1122 
1123  /// Sink plugins may need to call this function to notify the audio thread that it should wake up
1124  /// in order to potentially process an audio frame. Note that the audio thread may wake up for other
1125  /// reasons, for example following calls to AK::SoundEngine::RenderAudio().
1126  /// Once the audio thread is awaken, it will ask the sink plugin how many audio frames need to be
1127  /// processed and presented to the plugin. This is done through AK::IAkSinkPlugin::IsDataNeeded()
1128  /// and AK::IAkSinkPlugin::Consume() respectively.
1129  /// Note that only the sink plugin that is instantiated on the main output device (primary tree) may control
1130  /// the audio thread synchronization.
1131  /// \return AK_Success if the calling plugin is instantiated on the main output device (primary tree),
1132  /// AK_Fail otherwise.
1133  /// \sa
1134  /// - AK::IAkSinkPluginContext::IsPrimary()
1135  /// - AK::IAkSinkPlugin::IsDataNeeded()
1136  /// - AK::IAkSinkPlugin::Consume()
1138 
1139  /// Query engine's user-defined sink queue depth (AkPlatformInitSettings::uNumRefillsInVoice).
1140  /// \return The engine's AkPlatformInitSettings::uNumRefillsInVoice value on platforms for which it exists, 0 otherwise.
1142 
1143  /// Compute the speaker volume matrix of built-in positioning in Wwise from given positioning data and input and output channel configurations.
1144  /// Any known (non-anonymous) combination of configurations will work. For example, ambisonics will be decoded or encoded if needed.
1145  /// \aknote The function will fail if the input or output configuration is object-based, as the speaker volume matrix would be undefined.\endaknote
1146  /// All panning or spatialization types are honored.
1147  /// 3D Spatialization is performed relative to the default listener position (0,0,0) and orientation, where the front vector is (0,0,1) and the top vector is (0,1,0), left handed.
1148  /// \return AK_Success if succeeded, AK_InvalidParameter if the input or output configuration is object-based, or AK_Fail if the channel configurations are unknown or unhandled.
1150  const AkPositioningData& in_posData, ///< Positioning data. The field "threeD" is ignored if in_posData.behavioral.spatMode is AK_SpatializationMode_None.
1151  AkChannelConfig in_inputConfig, ///< Channel configuration of the input.
1152  AkChannelConfig in_outputConfig, ///< Channel configuration of the output.
1153  AK::SpeakerVolumes::MatrixPtr out_mxVolumes ///< Returned volumes matrix. Must be preallocated using AK::SpeakerVolumes::Matrix::GetRequiredSize() (see AK::SpeakerVolumes::Matrix services).
1154  ) = 0;
1155 
1156  /// Returns the panning rule for the output device to which the sink plug-in is attached.
1157  virtual AkPanningRule GetPanningRule() const = 0;
1158 
1159  /// Associates a custom data pointer to the output device information to which the sink plug-in is attached.
1160  ///
1161  /// This custom data pointer can then be queried by other plug-ins via AK::IAkPluginContextBase::GetOutputDeviceInfo.
1162  ///
1163  /// If the pointer points to an object, this object must remain valid for the entirety of the sink's lifetime.
1165  void* in_pCustomData ///< Pointer to custom data. Can be NULL to unset data.
1166  ) = 0;
1167  };
1168 
1170  {
1173  };
1174 
1175  /// Software interface for sink (audio endpoint) plugins.
1176  /// This interface should not be implemented directly,
1177  /// Plug-ins should either implement:
1178  /// - IAkSinkPlugin: for audio endpoint that do not support 3D audio, or
1179  /// - IAk3DAudioSinkPlugin: for audio endpoints that support 3D audio features.
1181  {
1182  public:
1183  /// Initialization of the sink plugin.
1184  ///
1185  /// This method prepares the audio device plug-in for data processing, allocates memory, and sets up initial conditions.
1186  /// The plug-in is passed in a pointer to a memory allocator interface (AK::IAkPluginMemAlloc).You should perform all dynamic memory allocation through this interface using the provided memory allocation macros(see \ref fx_memory_alloc).For the most common memory allocation needs, namely allocation at initialization and release at termination, the plug-in does not need to retain a pointer to the allocator.It will also be provided to the plug-in on termination.
1187  /// The AK::IAkSinkPluginContext interface allows to retrieve information related to the context in which the audio device plug-in is operated.
1188  /// The plug-in also receives a pointer to its associated parameter node interface (AK::IAkPluginParam).Most plug-ins will want to keep a reference to the associated parameter node to be able to retrieve parameters at runtime. See \ref iakeffectparam_communication for more details.
1189  /// All of these interfaces will remain valid throughout the plug-in's lifespan so it is safe to keep an internal reference to them when necessary.
1190  /// Plug-ins also receive the output audio format(which stays the same during the lifespan of the plug-in) to be able to allocate memory and setup processing for a given channel configuration.
1191  /// Note that the channel configuration is suggestive and may even be specified as not AkChannelConfig::IsValid().The plugin is free to determine the true channel configuration(this is an io parameter).
1192  ///
1193  /// \return AK_Success if successful.
1194  /// \return AK_NotCompatible if the system doesn't support this sink type. Return this if you want to fall back to the default sinks. This sink will never be requested again. Do not return this code if the device is simply unplugged.
1195  /// \return AK_DeviceNotCompatible if the requested output device doesn't support this sink type. Return this if you want to fall back to the dummy audio sink, which will result in no audio for the associated bus hierarchy. This sink will never be requested again.
1196  /// All other return codes will be treated as temporary failures conditions and the sink will be requested again later.
1197 
1198  virtual AKRESULT Init(
1199  IAkPluginMemAlloc * in_pAllocator, ///< Interface to memory allocator to be used by the effect.
1200  IAkSinkPluginContext * in_pSinkPluginContext, ///< Interface to sink plug-in's context.
1201  IAkPluginParam * in_pParams, ///< Interface to plug-in parameters.
1202  AkAudioFormat & io_rFormat ///< Audio data format of the input signal. Note that the channel configuration is suggestive and may even be specified as not AkChannelConfig::IsValid(). The plugin is free to determine the true channel configuration.
1203  ) = 0;
1204 
1205  /// Obtain the number of audio frames that should be processed by the sound engine and presented
1206  /// to this plugin via AK::IAkSinkPlugin::Consume(). The size of a frame is determined by the sound engine and
1207  /// obtainable via AK::IAkPluginContextBase::GetMaxBufferLength().
1208  /// \return AK_Success if successful, AK_Fail if there was a critical error.
1209  /// \sa
1210  /// - AK::IAkSinkPlugin::Consume()
1211  /// - AK::IAkSinkPluginContext::SignalAudioThread()
1213  AkUInt32& out_uNumFramesNeeded ///< Returned number of audio frames needed.
1214  ) = 0;
1215 
1216  /// Called at the end of the audio frame. If no Consume calls were made prior to OnFrameEnd, this means no audio was sent to the device. Assume silence.
1217  /// \sa
1218  /// - AK::IAkSinkPlugin::Consume()
1219  virtual void OnFrameEnd() = 0;
1220 
1221  /// Ask the plug-in whether starvation occurred.
1222  /// \return True if starvation occurred, false otherwise.
1223  virtual bool IsStarved() = 0;
1224 
1225  /// Reset the "starvation" flag after IsStarved() returned true.
1226  virtual void ResetStarved() = 0;
1227 
1229  };
1230 
1231  /// Software interface for sink (audio endpoint) plugins.
1233  {
1234  protected:
1235  /// Virtual destructor on interface to avoid warnings.
1236  virtual ~IAkSinkPlugin() {}
1237 
1238  public:
1239  /// Present an audio buffer to the sink. The audio buffer is in the native format of the sound engine
1240  /// (typically float, deinterleaved), as specified by io_rFormat passed to Init(). It is up to the
1241  /// plugin to transform it into a format that is compatible with its output.
1242  /// Note that Consume() is not called if the output for this frame consists of silence. Plugins should
1243  /// detect this in OnFrameEnd().
1244  /// \sa
1245  /// - AK::IAkSinkPlugin::IsDataNeeded()
1246  /// - AK::IAkSinkPlugin::OnFrameEnd()
1247  virtual void Consume(
1248  AkAudioBuffer * in_pInputBuffer, ///< Input audio buffer data structure. Plugins should avoid processing data in-place.
1249  AkRamp in_gain ///< Volume gain to apply to this input (prev corresponds to the beginning, next corresponds to the end of the buffer).
1250  ) = 0;
1251 
1252  virtual AkSinkPluginType GetSinkPluginType() const override final { return AkSinkPluginType_Sink; }
1253  };
1254 
1255  /// Software plug-in interface for sink (audio end point) which supports 3D audio features.
1257  {
1258  protected:
1259  /// Virtual destructor on interface to avoid warnings.
1261 
1262  public:
1263  /// Returns the capabilities of the sink's 3D audio system
1265  Ak3DAudioSinkCapabilities& out_rCapabilities ///< Capabilities of the 3D Audio system
1266  ) = 0;
1267 
1268  /// Same as AK::IAkSinkPlugin::Consume(), but receives 3 inputs: the main mix,the stereo passthrough and 3d audio objects.
1269  /// \sa
1270  /// - AK::IAkSinkPlugin::Consume()
1271  /// - AK::IAkSinkPlugin::IsDataNeeded()
1272  /// - AK::IAkSinkPlugin::OnFrameEnd()
1273  virtual void Consume(
1274  AkAudioBuffer* in_pMainMix, ///< Audio buffer data structure for the main mix (binauralized or not, depending on if binauralization is supported and enabled).
1275  AkAudioBuffer* in_pPassthroughMix, ///< The stereo mix to send out to the system in passthrough fashion (no binauralization). NULL if the channel configuration of the device is not object-based or does not have a passthrough.
1276  const AkAudioObjects& in_objects, ///< 3D Audio objects and object audio buffers to be consumed. The audio buffers are in the native format of the sound engine (typically float, deinterleaved), as specified by io_rFormat passed to Init(). It is up to the plugin to transform it into a format that is compatible with its output.
1277  AkRamp in_gain ///< Volume gain to apply to all inputs.
1278  ) = 0;
1279 
1280  virtual AkSinkPluginType GetSinkPluginType() const override final { return AkSinkPluginType_3DAudioSink; }
1281  };
1282 
1283  /// Wwise sound engine source plug-in interface (see \ref soundengine_plugins_source).
1285  {
1286  protected:
1287  /// Virtual destructor on interface to avoid warnings.
1288  virtual ~IAkSourcePlugin(){}
1289 
1290  public:
1291  /// Source plug-in initialization. Gets the plug-in ready for data processing, allocates memory and sets up the initial conditions.
1292  /// \aknote Memory allocation should be done through the appropriate macros (see \ref fx_memory_alloc). \endaknote
1293  /// \sa
1294  /// - \ref iaksourceeffect_init
1295  virtual AKRESULT Init(
1296  IAkPluginMemAlloc * in_pAllocator, ///< Interface to the memory allocator to be used by the plug-in
1297  IAkSourcePluginContext * in_pSourcePluginContext, ///< Interface to the source plug-in's context
1298  IAkPluginParam * in_pParams, ///< Interface to the plug-in parameters
1299  AkAudioFormat & io_rFormat ///< Audio format of the output data to be produced by the plug-in (mono native by default)
1300  ) = 0;
1301 
1302  /// This method is called to determine the approximate duration of the source.
1303  /// \return The duration of the source, in milliseconds.
1304  /// \sa
1305  /// - \ref iaksourceeffect_getduration
1306  virtual AkReal32 GetDuration() const = 0;
1307 
1308  /// This method is called to determine the estimated envelope of the source.
1309  /// \return The estimated envelope of the data that will be generated in the next call to
1310  /// Execute(). The envelope value should be normalized to the highest peak of the entire
1311  /// duration of the source. Expected range is [0,1]. If envelope and peak value cannot be
1312  /// predicted, the source should return 1 (no envelope).
1313  /// \sa
1314  /// - \ref iaksourceeffect_getenvelope
1315  virtual AkReal32 GetEnvelope() const
1316  {
1317  return 1.f;
1318  }
1319 
1320  /// This method is called to tell the source to stop looping.
1321  /// This will typically be called when an action of type "break" will be triggered on the playing source.
1322  /// Break (or StopLooping) means: terminate gracefully... if possible. In most situations it finishes the current loop and plays the sound release if there is one.
1323  ///
1324  /// \return
1325  /// - \c AK_Success if the source ignores the break command and plays normally till the end or if the source support to stop looping and terminates gracefully.
1326  /// - \c AK_Fail if the source cannot simply stop looping, in this situation, the break command will end up stopping this source.
1327  /// \sa
1328  /// - \ref iaksourceeffect_stoplooping
1329  virtual AKRESULT StopLooping(){ return AK_Success; }
1330 
1331  /// This method is called to tell the source to seek to an arbitrary sample.
1332  /// This will typically be called when the game calls AK::SoundEngine::SeekOnEvent() where the event plays
1333  /// a sound that wraps this source plug-in.
1334  /// If the plug-in does not handle seeks, it should return AK_Success. If it returns AK_Fail, it will
1335  /// be terminated by the sound engine.
1336  ///
1337  /// \return
1338  /// - \c AK_Success if the source handles or ignores seek command.
1339  /// - \c AK_Fail if the source considers that seeking requests should provoke termination, for example, if
1340  /// the desired position is greater than the prescribed source duration.
1341  /// \sa
1342  /// - AK::SoundEngine::SeekOnEvent()
1343  virtual AKRESULT Seek(
1344  AkUInt32 /* in_uPosition */ ///< Position to seek to, in samples, at the rate specified in AkAudioFormat (see AK::IAkSourcePlugin::Init()).
1345  ) { return AK_Success; }
1346 
1347  /// Skips execution when the voice is virtual playing from elapsed time to simulate processing that would have taken place (e.g. update internal state) while
1348  /// avoiding most of the CPU hit of plug-in execution.
1349  /// Given the number of frames requested adjust the number of frames that would have been produced by a call to Execute() in the io_uFrames parameter and return and
1350  /// return AK_DataReady or AK_NoMoreData, depending if there would be audio output or not at that point.
1351  /// Returning AK_NotImplemented will trigger a normal execution of the voice (as if it was not virtual) thus not enabling the CPU savings of a proper from elapsed time behavior.
1352  /// Note that returning AK_NotImplemeted for a source plug-ins that support asynchronous processing will produce a 'resume' virtual voice behavior instead.
1354  AkUInt32 & /*io_uFrames */ ///< (Input) Number of frames that the audio buffer processing can advance (equivalent to MaxFrames()). The output value should be the number of frames that would be produced this execution.
1355  ) { return AK_NotImplemented; }
1356 
1357  /// Software effect plug-in DSP execution.
1358  /// \aknote The effect can output as much as wanted up to MaxFrames(). All sample frames passed uValidFrames at input time are
1359  /// not initialized and it is the responsibility of the effect to do so. When modifying the number of valid frames within execution
1360  /// (e.g. to flush delay lines) the effect should notify the pipeline by updating uValidFrames accordingly.
1361  /// \aknote The effect will stop being called by the pipeline when AK_NoMoreData is returned in the the eState field of the AkAudioBuffer structure.
1362  virtual void Execute(
1363  AkAudioBuffer * io_pBuffer ///< In/Out audio buffer data structure (in-place processing)
1364  ) = 0;
1365  };
1366 
1367 
1368  /// This function can be useful to convert from normalized floating point audio samples to HW-pipeline format samples.
1369  #define AK_FLOAT_TO_SAMPLETYPE( __in__ ) (__in__)
1370  /// This function can be useful to convert from normalized floating point audio samples to HW-pipeline format samples when the input is not not to exceed (-1,1) range.
1371  #define AK_FLOAT_TO_SAMPLETYPE_NOCLIP( __in__ ) (__in__)
1372  /// This function can be useful to convert from HW-pipeline format samples to normalized floating point audio samples.
1373  #define AK_SAMPLETYPE_TO_FLOAT( __in__ ) (__in__)
1374 
1375  #define AK_DBTOLIN( __db__ ) (powf(10.f,(__db__) * 0.05f))
1376 }
1377 
1378 /// Registered plugin creation function prototype.
1380 /// Registered plugin parameter node creation function prototype.
1382 /// Registered plugin device enumeration function prototype, used for providing lists of devices by plug-ins.
1384  AkUInt32& io_maxNumDevices, ///< In: The length of the out_deviceDescriptions array, or zero is out_deviceDescriptions is null. Out: If out_deviceDescriptions is not-null, this should be set to the number of entries in out_deviceDescriptions that was populated (and should be less-than-or-equal to the initial value). If out_deviceDescriptions is null, this should be set to the maximum number of devices that may be returned by this callback.
1385  AkDeviceDescription* out_deviceDescriptions ///< The output array of device descriptions. If this is not-null, there will be a number of entries equal to the input value of io_maxNumDevices.
1386  );
1387 
1388 struct AkPlatformInitSettings;
1389 struct AkInitSettings;
1390 
1391 namespace AK
1392 {
1394  {
1406  };
1407 
1408  /// Common interface for plug-in services accessed through the global plug-in context
1410  {
1411  protected:
1412  virtual ~IAkPluginService() {}
1413  };
1414 
1415  /// Global plug-in context used for plug-in registration/initialization.
1416  /// Games query this interface from the sound engine, via AK::SoundEngine::GetGlobalPluginContext. Plug-ins query it via IAkPluginContextBase::GlobalContext.
1418  {
1419  protected:
1420  /// Virtual destructor on interface to avoid warnings.
1422 
1423  public:
1424 
1425  /// Retrieve the streaming manager access interface.
1426  virtual IAkStreamMgr * GetStreamMgr() const = 0;
1427 
1428  /// Retrieve the maximum number of frames that Execute() will be called with for this effect.
1429  /// Can be used by the effect to make memory allocation at initialization based on this worst case scenario.
1430  /// \return Maximum number of frames.
1431  virtual AkUInt16 GetMaxBufferLength() const = 0;
1432 
1433  /// Query whether sound engine is in real-time or offline (faster than real-time) mode.
1434  /// \return true when sound engine is in offline mode, false otherwise.
1435  virtual bool IsRenderingOffline() const = 0;
1436 
1437  /// Retrieve the core sample rate of the engine. This sample rate applies to all effects except source plugins, which declare their own sample rate.
1438  /// \return Core sample rate.
1439  virtual AkUInt32 GetSampleRate() const = 0;
1440 
1441  /// Post a monitoring message or error string. This will be displayed in the Wwise capture
1442  /// log.
1443  /// \return AK_Success if successful, AK_Fail if there was a problem posting the message.
1444  /// In optimized mode, this function returns AK_NotCompatible.
1445  /// \remark This function is provided as a tracking tool only. It does nothing if it is
1446  /// called in the optimized/release configuration and return AK_NotCompatible.
1448  const char* in_pszError, ///< Message or error string to be displayed
1449  AK::Monitor::ErrorLevel in_eErrorLevel ///< Specifies whether it should be displayed as a message or an error
1450  ) = 0;
1451 
1452  /// Register a plug-in with the sound engine and set the callback functions to create the
1453  /// plug-in and its parameter node.
1454  /// \sa
1455  /// - \ref register_effects
1456  /// - \ref plugin_xml
1457  /// \return AK_Success if successful, AK_InvalidParameter if invalid parameters were provided or Ak_Fail otherwise. Possible reasons for an AK_Fail result are:
1458  /// - Insufficient memory to register the plug-in
1459  /// - Plug-in ID already registered
1460  /// \remarks
1461  /// Codecs and plug-ins must be registered before loading banks that use them.\n
1462  /// Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
1463  /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
1464  /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
1465  /// posting the event will fail.
1467  AkPluginType in_eType, ///< Plug-in type (for example, source or effect)
1468  AkUInt32 in_ulCompanyID, ///< Company identifier (as declared in the plug-in description XML file)
1469  AkUInt32 in_ulPluginID, ///< Plug-in identifier (as declared in the plug-in description XML file)
1470  AkCreatePluginCallback in_pCreateFunc, ///< Pointer to the plug-in's creation function
1471  AkCreateParamCallback in_pCreateParamFunc ///< Pointer to the plug-in's parameter node creation function
1472  ) = 0;
1473 
1474  /// Register a codec type with the sound engine and set the callback functions to create the
1475  /// codec's file source and bank source nodes.
1476  /// \sa
1477  /// - \ref register_effects
1478  /// \return AK_Success if successful, AK_InvalidParameter if invalid parameters were provided, or Ak_Fail otherwise. Possible reasons for an AK_Fail result are:
1479  /// - Insufficient memory to register the codec
1480  /// - Codec ID already registered
1481  /// \remarks
1482  /// Codecs and plug-ins must be registered before loading banks that use them.\n
1483  /// Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
1484  /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
1485  /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
1486  /// posting the event will fail.
1488  AkUInt32 in_ulCompanyID, ///< Company identifier (as declared in XML)
1489  AkUInt32 in_ulPluginID, ///< Plugin identifier (as declared in XML)
1490  AkCreateFileSourceCallback in_pFileCreateFunc, ///< Factory for streaming sources.
1491  AkCreateBankSourceCallback in_pBankCreateFunc ///< Factory for in-memory sources.
1492  ) = 0;
1493 
1494  /// Register a global callback function. This function will be called from the audio rendering thread, at the
1495  /// location specified by in_eLocation. This function will also be called from the thread calling
1496  /// AK::SoundEngine::Term with in_eLocation set to AkGlobalCallbackLocation_Term.
1497  /// For example, in order to be called at every audio rendering pass, and once during teardown for releasing resources, you would call
1498  /// RegisterGlobalCallback(AkPluginTypeEffect, MY_COMPANY_ID , MY_PLUGIN_ID, myCallback, AkGlobalCallbackLocation_BeginRender | AkGlobalCallbackLocation_Term, myCookie);
1499  /// \remarks
1500  /// A valid (not AkPluginTypeNone) Plugin Type, Company ID and valid (non-zero) Plug-in ID of the plug-in registering the callback must be provided to this function.
1501  /// The timing of the callback function will contribute to the timing of the plug-in registered (Total Plug-in CPU and Advanced Profiler Plug-in tab).
1502  /// Timers will be registered to callbacks at all locations except for \c AkGlobalCallbackLocation::AkGlobalCallbackLocation_Register and \c AkGlobalCallbackLocation::AkGlobalCallbackLocation_Term.
1503  /// It is only legal to call this function from inside the plug-in registration callback, exclusively when receiving \c AkGlobalCallbackLocation::AkGlobalCallbackLocation_Register.
1504  /// This function should not be called from inside the plug-in instance (e.g. in Init, Execute, etc.) to prevent deadlocks when processing plug-ins in parallel.
1505  /// It is illegal to call this function while already inside of a registered global callback.
1506  /// This function might stall for several milliseconds before returning.
1507  /// \sa
1508  /// - \ref fx_global_hooks
1509  /// - AK::IAkGlobalPluginContext::UnregisterGlobalCallback()
1510  /// - AkGlobalCallbackFunc
1511  /// - AkGlobalCallbackLocation
1513  AkPluginType in_eType, ///< A valid Plug-in type (for example, source or effect).
1514  AkUInt32 in_ulCompanyID, ///< Company identifier (as declared in the plug-in description XML file).
1515  AkUInt32 in_ulPluginID, ///< Plug-in identifier (as declared in the plug-in description XML file).
1516  AkGlobalCallbackFunc in_pCallback, ///< Function to register as a global callback.
1517  AkUInt32 in_eLocation = AkGlobalCallbackLocation_BeginRender, ///< Callback location defined in AkGlobalCallbackLocation. Bitwise OR multiple locations if needed.
1518  void * in_pCookie = NULL ///< User cookie.
1519  ) = 0;
1520 
1521  /// Unregister a global callback function, previously registered using RegisterGlobalCallback.
1522  /// \remarks
1523  /// It is only legal to call this function from inside the plug-in registration global callback, exclusively when receiving \c AkGlobalCallbackLocation::AkGlobalCallbackLocation_Term.
1524  /// This function should not be called from inside the plug-in instance (e.g. in Init, Execute, etc.) to prevent deadlocks when processing plug-ins in parallel.
1525  /// It is illegal to call this function while already inside of a registered global callback.
1526  /// This function might stall for several milliseconds before returning.
1527  /// \sa
1528  /// - \ref fx_global_hooks
1529  /// - AK::IAkGlobalPluginContext::RegisterGlobalCallback()
1530  /// - AkGlobalCallbackFunc
1531  /// - AkGlobalCallbackLocation
1533  AkGlobalCallbackFunc in_pCallback, ///< Function to unregister as a global callback.
1534  AkUInt32 in_eLocation = AkGlobalCallbackLocation_BeginRender ///< Must match in_eLocation as passed to RegisterGlobalCallback for this callback.
1535  ) = 0;
1536 
1537  /// Get the default allocator for plugins. This is useful for performing global initialization tasks shared across multiple plugin instances.
1539 
1540  /// \sa SetRTPCValue
1542  AkRtpcID in_rtpcID, ///< ID of the game parameter
1543  AkRtpcValue in_value, ///< Value to set
1544  AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT,///< Associated game object ID
1545  AkTimeMs in_uValueChangeDuration = 0, ///< Duration during which the game parameter is interpolated towards in_value
1546  AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the game parameter interpolation
1547  bool in_bBypassInternalValueInterpolation = false ///< True if you want to bypass the internal "slew rate" or "over time filtering" specified by the sound designer. This is meant to be used when for example loading a level and you dont want the values to interpolate.
1548  ) = 0;
1549 
1550  /// Send custom game data to a plugin that resides on a bus (insert effect or mixer plugin).
1551  /// Data will be copied and stored into a separate list.
1552  /// Previous entry is deleted when a new one is sent.
1553  /// Set the data pointer to NULL to clear item from the list.
1554  /// This means that you cannot send different data to various instances of the plugin on a same bus.\endaknote
1555  /// \return AK_Success if data was sent successfully.
1557  AkUniqueID in_busID, ///< Bus ID
1558  AkGameObjectID in_busObjectID, ///< Bus Object ID
1559  AkPluginType in_eType, ///< Plug-in type (for example, source or effect)
1560  AkUInt32 in_uCompanyID, ///< Company identifier (as declared in the plug-in description XML file)
1561  AkUInt32 in_uPluginID, ///< Plug-in identifier (as declared in the plug-in description XML file)
1562  const void* in_pData, ///< The data blob
1563  AkUInt32 in_uSizeInBytes ///< Size of data
1564  ) = 0;
1565 
1566  /// Computes gain vector for encoding a source with angles in_fAzimuth and in_fElevation to full-sphere ambisonics with order in_uOrder.
1567  /// Ambisonic channels are ordered by ACN and use the SN3D convention.
1569  AkReal32 in_fAzimuth, ///< Incident angle, in radians [-pi,pi], where 0 is the front (positive values are clockwise).
1570  AkReal32 in_fElevation, ///< Incident angle, in radians [-pi/2,pi/2], where 0 is the azimuthal plane.
1571  AkChannelConfig in_cfgAmbisonics, ///< Determines number of gains in vector out_vVolumes.
1572  AK::SpeakerVolumes::VectorPtr out_vVolumes ///< Returned volumes (see AK::SpeakerVolumes::Vector services). Must be allocated prior to calling this function with the size returned by AK::SpeakerVolumes::Vector::GetRequiredSize() for the desired number of channels.
1573  ) = 0;
1574 
1575  /// Computes gain matrix for decoding an SN3D-normalized ACN-ordered ambisonic signal of order sqrt(in_cfgAmbisonics.uNumChannels)-1, with max-RE weighting function, on a (regularly) sampled sphere whose samples in_samples are
1576  /// expressed in left-handed cartesian coordinates, with unitary norm.
1577  /// This decoding technique is optimal for regular sampling.
1578  /// The returned matrix has in_cfgAmbisonics.uNumChannels inputs (rows) and in_uNumSamples outputs (columns), and is normalized by the number of samples.
1579  /// You may use the returned volume matrix with IAkPluginServiceMixer::MixNinNChannels.
1580  /// Supported ambisonic configurations are full-sphere 1st to 5th order.
1581  /// \return
1582  /// - \c AK_InvalidParameter if in_cfgAmbisonics is not an ambisonic configuration.
1583  /// - \c AK_InvalidParameter if in_cfgAmbisonics does not have enough channel for a valid ambisonic configuration of the specified order.
1584  /// - \c AK_InvalidParameter if in_samples contains non-normalized vectors (not unity length).
1585  /// - \c AK_Success otherwise.
1587  const AkVector in_samples[], ///< Array of vector samples expressed in left-handed cartesian coordinates, where (1,0,0) points towards the right and (0,1,0) points towards the top. Vectors must be normalized.
1588  AkUInt32 in_uNumSamples, ///< Number of points in in_samples.
1589  AkChannelConfig in_cfgAmbisonics, ///< Ambisonic configuration. Supported configurations are 1st to 5th order. Determines number of rows (input channels) in matrix out_mxVolume.
1590  AK::SpeakerVolumes::MatrixPtr out_mxVolume ///< Returned volume matrix of in_cfgAmbisonics.uNumChannels rows x in_uNumSamples colums. Must be allocated prior to calling this function with the size returned by AK::SpeakerVolumes::Matrix::GetRequiredSize() for the desired number of channels.
1591  ) = 0;
1592 
1593  /// Return an acoustic texture.
1594  /// \return The pointer to an acoustic texture if successful, NULL otherwise.
1596  AkAcousticTextureID in_AcousticTextureID ///< Acoustic Texture's ID
1597  ) = 0;
1598 
1599  /// Given an emitter-listener pair, compute the azimuth and elevation angles of the emitter relative to the listener.
1600  /// \return AK_Success if the listener referenced in the emitter-listener pair was found; azimuth and elevation.
1602  const AkEmitterListenerPair & in_pair, ///< Emitter-listener pair for which to compute azimuth and elevation angles.
1603  AkReal32 & out_fAzimuth, ///< Returned azimuthal angle, in radians.
1604  AkReal32 & out_fElevation ///< Returned elevation angle, in radians.
1605  ) const = 0;
1606 
1607  /// Get the platform init settings that the wwise sound engine has been initialized with.
1608  /// This function returns a null pointer if called with an instance of RenderFXGlobalContext.
1610 
1611  /// Get the init settings that the wwise sound engine has been initialized with
1612  /// This function returns a null pointer if called with an instance of RenderFXGlobalContext.
1613  virtual const AkInitSettings* GetInitSettings() const = 0;
1614 
1615  /// Gets the configured audio settings.
1616  /// Call this function to get the configured audio settings.
1617  ///
1618  /// \warning This function is not thread-safe.
1619  /// \warning Call this function only after the sound engine has been properly initialized.
1621  AkAudioSettings & out_audioSettings ///< Returned audio settings
1622  ) const = 0;
1623 
1624  /// Universal converter from string to ID for the sound engine.
1625  /// Calls AK::SoundEngine::GetIDFromString.
1626  /// \sa
1627  /// - <tt>AK::SoundEngine::GetIDFromString</tt>
1628  virtual AkUInt32 GetIDFromString(const char* in_pszString) const = 0;
1629 
1630  /// Synchronously posts an Event to the sound engine (by event ID).
1631  /// The callback function can be used to be noticed when markers are reached or when the event is finished.
1632  /// An array of wave file sources can be provided to resolve External Sources triggered by the event.
1633  /// \return The playing ID of the event launched, or AK_INVALID_PLAYING_ID if posting the event failed
1634  /// \remarks
1635  /// This function executes the actions contained in the event without going through the message queue.
1636  /// In order to do so it acquires the global Wwise sound engine lock. It should therefore only be called from one of the
1637  /// global engine hooks (see AK::IAkGlobalPluginContext::RegisterGlobalCallback).
1638  /// Use AK::IAkGlobalPluginContext::GetIDFromString() if you use event names (strings).
1639  /// \sa
1640  /// - <tt>AK::SoundEngine::PostEvent</tt>
1641  /// - <tt>AK::IAkGlobalPluginContext::RegisterGlobalCallback</tt>
1642  /// - <tt>AK::IAkGlobalPluginContext::GetIDFromString</tt>
1644  AkUniqueID in_eventID, ///< Unique ID of the event
1645  AkGameObjectID in_gameObjectID, ///< Associated game object ID
1646  AkUInt32 in_uFlags = 0, ///< Bitmask: see \ref AkCallbackType
1647  AkCallbackFunc in_pfnCallback = NULL, ///< Callback function
1648  void * in_pCookie = NULL, ///< Callback cookie that will be sent to the callback function along with additional information
1649  AkUInt32 in_cExternals = 0, ///< Optional count of external source structures
1650  AkExternalSourceInfo *in_pExternalSources = NULL,///< Optional array of external source resolution information
1651  AkPlayingID in_PlayingID = AK_INVALID_PLAYING_ID///< Optional (advanced users only) Specify the playing ID to target with the event. Will Cause active actions in this event to target an existing Playing ID. Let it be AK_INVALID_PLAYING_ID or do not specify any for normal playback.
1652  ) = 0;
1653 
1654  /// Executes a number of MIDI Events on all nodes that are referenced in the specified Event in an Action of type Play.
1655  /// Each MIDI event will be posted in AkMIDIPost::uOffset samples from the start of the current frame. The duration of
1656  /// a sample can be determined from the sound engine's audio settings, via a call to AK::IAkGlobalPluginContext::GetAudioSettings.
1657  /// \remarks
1658  /// This function executes the MIDI Events without going through the message queue.
1659  /// In order to do so it acquires the global Wwise sound engine lock. It should therefore only be called from one of the
1660  /// global engine hooks (see AK::IAkGlobalPluginContext::RegisterGlobalCallback).
1661  /// Use AK::IAkGlobalPluginContext::GetIDFromString() if you use event names (strings).
1662  /// \sa
1663  /// - <tt>AK::SoundEngine::PostMIDIOnEvent</tt>
1664  /// - <tt>AK::IAkGlobalPluginContext::GetAudioSettings</tt>
1665  /// - <tt>AK::IAkGlobalPluginContext::StopMIDIOnEventSync</tt>
1666  /// - <tt>AK::IAkGlobalPluginContext::RegisterGlobalCallback</tt>
1667  /// - <tt>AK::IAkGlobalPluginContext::GetIDFromString</tt>
1669  AkUniqueID in_eventID, ///< Unique ID of the Event
1670  AkGameObjectID in_gameObjectID, ///< Associated game object ID
1671  AkMIDIPost* in_pPosts, ///< MIDI Events to post
1672  AkUInt16 in_uNumPosts, ///< Number of MIDI Events to post
1673  bool in_bAbsoluteOffsets = false, ///< Whether AkMIDIPost::uOffset values are relative to current frame or absolute
1674  AkUInt32 in_uFlags = 0, ///< Bitmask: see \ref AkCallbackType
1675  AkCallbackFunc in_pfnCallback = NULL, ///< Callback function
1676  void * in_pCookie = NULL, ///< Callback cookie that will be sent to the callback function along with additional information
1677  AkPlayingID in_playingID = AK_INVALID_PLAYING_ID ///< Target playing ID
1678  ) = 0;
1679 
1680  /// Stops MIDI notes on all nodes that are referenced in the specified event in an action of type play,
1681  /// with the specified Game Object. Invalid parameters are interpreted as wildcards. For example, calling
1682  /// this function with in_eventID set to AK_INVALID_UNIQUE_ID will stop all MIDI notes for Game Object
1683  /// in_gameObjectID.
1684  /// \remarks
1685  /// This function stops the MIDI notes without going through the message queue.
1686  /// In order to do so it acquires the global Wwise sound engine lock. It should therefore only be called from one of the
1687  /// global engine hooks (see AK::IAkGlobalPluginContext::RegisterGlobalCallback).
1688  /// Use AK::IAkGlobalPluginContext::GetIDFromString() if you use event names (strings).
1689  /// \sa
1690  /// - <tt>AK::IAkGlobalPluginContext::PostMIDIOnEvent</tt>
1691  /// - <tt>AK::IAkGlobalPluginContext::GetIDFromString</tt>
1693  AkUniqueID in_eventID = AK_INVALID_UNIQUE_ID, ///< Unique ID of the Event
1694  AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT, ///< Associated game object ID
1695  AkPlayingID in_playingID = AK_INVALID_PLAYING_ID ///< Target playing ID
1696  ) = 0;
1697 
1698  /// \return The gateway to platform-specific functionality
1699  /// \sa IAkPlatformContext
1701 
1702  /// Retrieves a plug-in service to provide specific "helper" functionality. Note that each service should provide
1703  /// macros that handle the casting to the appropriate service, and are recommended instead of calling this directly.
1704  /// Note that all plug-in service are statically allocated, and any references to them can be cached without lifetime checks.
1706  AkPluginServiceType in_pluginService ///< Enum value for the specific plug-in service to fetch
1707  ) const = 0;
1708 
1709  /// Obtains the current audio output buffer tick. This corresponds to the number of buffers produced by
1710  /// the sound engine since initialization.
1711  /// \return Tick count.
1712  virtual AkUInt32 GetBufferTick() const = 0;
1713  };
1714 
1715  /// Interface for the "Mixer" plug-in service, to handle mixing together of signals, or applying simple transforms
1717  {
1718  protected:
1720  public:
1721  /// N to N channels mix
1722  virtual void MixNinNChannels(
1723  AkAudioBuffer* in_pInputBuffer, ///< Input multichannel buffer.
1724  AkAudioBuffer* in_pMixBuffer, ///< Multichannel buffer with which the input buffer is mixed.
1725  AkReal32 in_fPrevGain, ///< Gain, corresponding to the beginning of the buffer, to apply uniformly to each mixed channel.
1726  AkReal32 in_fNextGain, ///< Gain, corresponding to the end of the buffer, to apply uniformly to each mixed channel.
1727  AK::SpeakerVolumes::ConstMatrixPtr in_mxPrevVolumes,///< In/out channel volume distribution corresponding to the beginning of the buffer (see AK::SpeakerVolumes::Matrix services).
1728  AK::SpeakerVolumes::ConstMatrixPtr in_mxNextVolumes ///< In/out channel volume distribution corresponding to the end of the buffer (see AK::SpeakerVolumes::Matrix services).
1729  ) = 0;
1730 
1731  /// 1 to N channels mix
1732  virtual void Mix1inNChannels(
1733  AkReal32* AK_RESTRICT in_pInChannel, ///< Input channel buffer.
1734  AkAudioBuffer* in_pMixBuffer, ///< Multichannel buffer with which the input buffer is mixed.
1735  AkReal32 in_fPrevGain, ///< Gain, corresponding to the beginning of the input channel.
1736  AkReal32 in_fNextGain, ///< Gain, corresponding to the end of the input channel.
1737  AK::SpeakerVolumes::ConstVectorPtr in_vPrevVolumes, ///< Output channel volume distribution corresponding to the beginning of the buffer (see AK::SpeakerVolumes::Vector services).
1738  AK::SpeakerVolumes::ConstVectorPtr in_vNextVolumes ///< Output channel volume distribution corresponding to the end of the buffer (see AK::SpeakerVolumes::Vector services).
1739  ) = 0;
1740 
1741  /// Single channel mix
1742  virtual void MixChannel(
1743  AkReal32* AK_RESTRICT in_pInBuffer, ///< Input channel buffer.
1744  AkReal32* AK_RESTRICT in_pOutBuffer, ///< Output channel buffer.
1745  AkReal32 in_fPrevGain, ///< Gain, corresponding to the beginning of the input channel.
1746  AkReal32 in_fNextGain, ///< Gain, corresponding to the end of the input channel.
1747  AkUInt16 in_uNumFrames ///< Number of frames to mix.
1748  ) = 0;
1749 
1750  /// Given non-interleaved audio in the provided in_pInputBuffer, will apply a ramping gain over the number
1751  /// of frames specified, and store the result in in_pOutputBuffer. Channel data from in_pInputBuffer will also be
1752  /// interleaved in in_pOutputBuffer's results, and optionally converted from 32-bit floats to 16-bit integers.
1754  AkAudioBuffer* in_pInputBuffer, ///< Input audioBuffer data
1755  AkAudioBuffer* in_pOutputBuffer, ///< Output audioBuffer data
1756  AkRamp in_gain, ///< Ramping gain to apply over duration of buffer
1757  bool in_convertToInt16 ///< Whether the input data should be converted to int16
1758  ) const = 0;
1759 
1760  /// Given non-interleaved audio in the provided in_pInputBuffer, will apply a ramping gain over the number
1761  /// of frames specified, and store the result in in_pOutputBuffer. Audio data in in_pOutputBuffer will have
1762  /// the same layout as in_pInputBuffer, and optionally converted from 32-bit floats to 16-bit integers.
1763  virtual void ApplyGain(
1764  AkAudioBuffer* in_pInputBuffer, ///< Input audioBuffer data
1765  AkAudioBuffer* in_pOutputBuffer, ///< Output audioBuffer data
1766  AkRamp in_gain, ///< Ramping gain to apply over duration of buffer
1767  bool in_convertToInt16 ///< Whether the input data should be converted to int16
1768  ) const = 0;
1769 
1770  // Applies a biquadfilter to in_uNumSamples # of samples of each channel using the input provided, to the output buffer,
1771  // with one set of coefficients for all channels, and an array of memories (one instance per channel)
1772  // (no mixing in the output occurs; the output buffer will be entirely replaced, and can be the same as the input buffer)
1773  virtual void ProcessBiquadFilter(
1774  AkAudioBuffer* in_pInputBuffer, ///< Input audioBuffer data
1775  AkAudioBuffer* io_pOutputBuffer, ///< Output audioBuffer data
1776  AK::AkBiquadCoefficients* in_pCoefs, ///< Pointer to coefficients to use for processing
1777  AK::AkBiquadMemories* io_pMemories, ///< Array of memories to use for processing (one instance per channel in the inputBuffer)
1778  AkUInt32 in_uNumSamples ///< Number of samples to process in each channel
1779  ) = 0;
1780 
1781  // Applies in_uNumInterpStages sets of biquadfilters to each channel of in_ppInputData (in_uNumInputs # of channels),
1782  // processing in_pNumSamplesPerInterpStage number of samples per stage. in_ppCoefs should be in_uNumInputs * in_uNumInterpStages long,
1783  // with in_uNumInputs coefficients for each stage of the process, with each coefficient being applied for each channel.
1784  // (no mixing in the output occurs; the output buffer will be entirely replaced, and can be the same as the input buffer)
1786  AkReal32** in_ppInputData, ///< Array of input buffers to process
1787  AkReal32** io_ppOutputData, ///< Array of output buffers to store results
1788  AK::AkBiquadCoefficients** in_ppCoefs, ///< Array of coefficients to use for processing (one instance per channel)
1789  AK::AkBiquadMemories** io_ppMemories, ///< Array of memories to use for processing (one instance per channel)
1790  AkUInt32* in_pNumSamplesPerInterpStage, ///< Number of samples to process in each channel in each stage of the process
1791  AkUInt32 in_uNumInterpStages, ///< Number of stages of the process to run
1792  AkUInt32 in_uNumChannels ///< Number of channels to process
1793  ) = 0;
1794 
1795  // Applies two biquadfilters to in_uNumSamples # of samples of each channel using the input provided, to the output buffer,
1796  // with two sets of coefficients for all channels, and with two arrays of memories (one instance per channel per biquad)
1797  // (no mixing in the output occurs; the output buffer will be entirely replaced, and can be the same as the input buffer)
1798  // If you have two biquads to run on a given signal, this is slightly faster than calling ProcessBiquadFilter twice
1800  AkAudioBuffer* in_pInputBuffer, ///< Array of input buffers to process
1801  AkAudioBuffer* io_pOutputBuffer, ///< Array of output buffers to store results
1802  AK::AkBiquadCoefficients* in_pCoefs1, ///< Pointer to coefficients to use for processing the first biquad
1803  AK::AkBiquadMemories* io_pMemories1, ///< Array of memories to use for processing the first biquad
1804  AK::AkBiquadCoefficients* in_pCoefs2, ///< Pointer to coefficients to use for processing the second biquad
1805  AK::AkBiquadMemories* io_pMemories2, ///< Array of memories to use for processing the second biquad
1806  AkUInt32 in_uNumSamples ///< Number of samples to process in each channel
1807  ) = 0;
1808 
1809  // Applies two in_uNumInterpStages sets of biquadfilters to each channel of in_ppInputData (in_uNumInputs # of channels),
1810  // processing in_pNumSamplesPerInterpStage number of samples per stage. Each in_ppCoefs should be in_uNumInputs * in_uNumInterpStages long,
1811  // with in_uNumInputs coefficients for each stage of the process, with each coefficient being applied for each channel.
1812  // (no mixing in the output occurs; the output buffer will be entirely replaced, and can be the same as the input buffer)
1813  // If you have two biquads to run on a given signal, this is slightly (~25%) faster than calling ProcessInterpBiquadFilter twice
1815  AkReal32** in_ppInputData, ///< Array of input buffers to process
1816  AkReal32** io_ppOutputData, ///< Array of output buffers to store results
1817  AK::AkBiquadCoefficients** in_ppCoefs1, ///< Array of coefficients to use for processing the first biquad
1818  AK::AkBiquadMemories** io_ppMemories1, ///< Array of memories to use for processing the first biquad
1819  AK::AkBiquadCoefficients** in_ppCoefs2, ///< Array of coefficients to use for processing the second biquad
1820  AK::AkBiquadMemories** io_ppMemories2, ///< Array of memories to use for processing the second biquad
1821  AkUInt32* in_pNumSamplesPerInterpStage, ///< Number of samples to process in each channel in each stage of the process
1822  AkUInt32 in_uNumInterpStages, ///< Number of stages of the process to run
1823  AkUInt32 in_uNumChannels ///< Number of channels to process
1824  ) = 0;
1825  };
1826 
1827  /// Interface for the services related to generating pseudorandom numbers
1828  /// \sa
1829  /// - <tt>AK::SoundEngine::SetRandomSeed()</tt>
1830  /// - <tt>CAkRng</tt>
1832  {
1833  protected:
1835  public:
1836  /// Advances and returns a PRNG seed that a plug-in may use in its own RNG for DSP processing
1837  /// This is the same seed used for the internal sound engine randomization.
1838  virtual AkUInt64 RandomSeed() const = 0;
1839 
1840  /// Advances the internal PRNG seed, and returns a random number generator suitable for DSP processing
1841  virtual CAkRng CreateRNG() const = 0;
1842  };
1843 
1844  /// Interface for the services related to extracting attenuation curves from audio objects and using them.
1846  {
1847  protected:
1849  public:
1850 
1851  /// Obtain the unique ID of the Attenuation curves attached to the provided audio object, as well as the
1852  /// value of the sound's Distance Scaling property.
1853  /// \return The unique ID of the Attenuation curves (Shareset or Custom). AK_INVALID_UNIQUE_ID if the audio object does not have Attenuation curves.
1855  const AkAudioObject& in_object, ///< Audio object from which to get the attenuation ID.
1856  AkReal32& out_distanceScaling ///< Returned value of the Distance Scaling property. 1 if the audio object does not have attenuation enabled.
1857  ) const = 0;
1858 
1859  /// Extract the curve of a given type from the set of Attenuation curves attached to the given audio object.
1860  /// The curve's data is copied into an opaque data structure, pointed to by out_curve.
1861  /// The curve's data remain until the client of this service calls AK::IAkPluginServiceAttenuationCurve::Delete.
1862  /// \return True if the copy succeeded, or if the requested curve was not initialized.
1863  virtual bool ExtractCurves(
1864  IAkPluginMemAlloc* in_pAllocator, ///< Memory allocator.
1865  const AkAudioObject & in_object, ///< The audio object from which to extract the curve.
1866  AkUInt32 in_curveTypesMask, ///< The set of curves, identified with a mask of bits offset by AkAttenuationCurveType values, to extract from the set of Attenuation curves. For example, set to (1 << AttenuationCurveID_VolumeDry | 1 << AttenuationCurveID_Spread) to obtain the distance-driven dry volume and spread curves.
1867  void* out_curves[] ///< The returned addresses of the requested curve data. Pass in an array of void* with length corresponding to the number of desired curves. For each curve, if it exists, a blob of data is allocated by the function and the address is returned in the corresponding item of the out_curves. The item is set to nullptr if the curve does not exist.
1868  ) const = 0;
1869 
1870  /// Free memory of curve obtained with AK::IAkPluginServiceAttenuationCurve::ExtractCurves.
1871  virtual void Delete(
1872  IAkPluginMemAlloc* in_pAllocator, ///< Memory allocator.
1873  void*& io_attenuationCurve ///< Curve to delete.
1874  ) = 0;
1875 
1876  /// Evaluate the value of a curve at given x coordinate.
1878  void*& io_attenuationCurve, ///< Curve to evaluate.
1879  AkReal32 x ///< Value on the abscissa.
1880  ) = 0;
1881 
1882  /// Some curves are serialized in the log domain. Use this function to convert all the points to linear at once.
1883  virtual void Linearize(void*& io_attenuationCurve) = 0;
1884 
1885  /// Get the ith point of the curve.
1886  virtual const AkRTPCGraphPoint& GetPoint(
1887  const void* in_attenuationCurve, ///< Curve.
1888  AkUInt32 i ///< Point index. Must be between 0 and AK::IAkPluginServiceAttenuationCurve::GetNumPoints-1 inclusively.
1889  ) const = 0;
1890 
1891  /// Get the number of points on a curve.
1893  const void* in_attenuationCurve ///< Curve.
1894  ) const = 0;
1895  };
1896 
1897  /// Interface for the audio object priority service, to retrieve and update playback priority on audio objects.
1898  /// Playback priority of the audio object may be used by the audio endpoint when there are more audio objects than the available hardware objects
1899  /// to determine which audio objects should be mixed as hardware objects in priority and which can be mixed to a lower resolution 3D bed.
1900  /// \sa
1901  /// - <a href="https://www.audiokinetic.com/library/edge/?source=Help&id=defining_playback_priority" target="_blank">Defining Playback Priority</a>
1902  /// - <tt>AkAudioObject</tt>
1903  /// - <tt>AkPriority</tt>
1905  {
1906  protected:
1908  public:
1909  /// Populates <tt>out_pPriorities</tt> with playback priorities for objects in <tt>in_ppObjects</tt>.
1910  virtual void GetPriorities(
1911  AkAudioObject** in_ppObjects, ///< Array of pointers to audio objects to extract priorites from.
1912  AkUInt32 in_uNumObjects, ///< The number of audio objects in <tt>in_ppObjects</tt>. Must correspond to the number of priorites in <tt>out_pPriorities</tt>.
1913  AkPriority* out_pPriorities ///< Priorities to fill from <tt>in_ppObjects</tt>. Must be large enough to contain <tt>in_uNumObjects</tt> priorities.
1914  ) = 0;
1915 
1916  /// Sets the playback priority of each of the <tt>in_uNumObjects</tt> audio objects in <tt>io_ppObjects</tt> from <tt>in_pPriorities</tt>.
1917  virtual void SetPriorities(
1918  AkAudioObject** io_ppObjects, ///< Array of pointers to audio objects for which to update the playback priority.
1919  AkUInt32 in_uNumObjects, ///< The number of audio objects in <tt>in_ppObjects</tt>. Must correspond to the number of priorites in <tt>in_pPriorities</tt>.
1920  AkPriority* in_pPriorities ///< Array of priorities to set on <tt>in_ppObjects</tt>. Must contain <tt>in_uNumObjects</tt> priorities.
1921  ) = 0;
1922  };
1923 
1924  /// Interface for the markers service.
1926  {
1927  protected:
1929  public:
1931  {
1932  public:
1933  /// Submit markers to trigger notifications for registered callback functions. Register callbacks through. Registering a callback can be achieved through the
1934  /// PostEvent function on AK::SoundEngine.
1935  /// \return
1936  /// - \c AK_NotInitialized if no callback functions have been registered.
1937  /// - \c AK_InvalidParameter if in_pMarkers is null.
1938  /// - \c AK_InvalidParameter if in_uOffsetsInBuffer is null.
1939  /// - \c AK_InvalidParameter if in_uNumMarkers is 0.
1940  /// - \c AK_InvalidParameter if any valus in in_uOffsetsInBuffer is greater or equal to the length of the buffer.
1941  /// - \c AK_Success otherwise.
1942  /// \sa
1943  /// - AK::SoundEngine::PostEvent()
1945  const AkAudioMarker* in_pMarkers, ///< Array of AkAudioMarker objects
1946  const AkUInt32* in_uOffsetsInBuffer, ///< Array of buffer offsets for each marker contained in <tt>in_pMarkers</tt>. Must provide a value for each marker in <tt>in_pMarkers</tt>.
1947  AkUInt32 in_uNumMarkers ///< The number of marker objects in <tt> in_pMarkers </tt>
1948  ) = 0;
1949  };
1950 
1952  IAkSourcePluginContext* in_pSourcePluginContext ///< Pointer to the source plugin context
1953  ) = 0;
1954 
1956  IAkMarkerNotificationService* io_pMarkerNotificationService ///< Pointer to the source plugin context
1957  ) = 0;
1958  };
1959 
1960  #define AK_GET_PLUGIN_SERVICE_MIXER(plugin_ctx) static_cast<AK::IAkPluginServiceMixer*>(plugin_ctx->GetPluginService(AK::PluginServiceType_Mixer))
1961  #define AK_GET_PLUGIN_SERVICE_RNG(plugin_ctx) static_cast<AK::IAkPluginServiceRNG*>(plugin_ctx->GetPluginService(AK::PluginServiceType_RNG))
1962  #define AK_GET_PLUGIN_SERVICE_AUDIO_OBJECT_ATTENUATION(plugin_ctx) static_cast<AK::IAkPluginServiceAudioObjectAttenuation*>(plugin_ctx->GetPluginService(AK::PluginServiceType_AudioObjectAttenuation))
1963  #define AK_GET_PLUGIN_SERVICE_AUDIO_OBJECT_PRIORITY(plugin_ctx) static_cast<AK::IAkPluginServiceAudioObjectPriority*>(plugin_ctx->GetPluginService(AK::PluginServiceType_AudioObjectPriority))
1964  #define AK_GET_PLUGIN_SERVICE_MARKERS(plugin_ctx) static_cast<AK::IAkPluginServiceMarkers*>(plugin_ctx->GetPluginService(AK::PluginServiceType_Markers))
1965 
1966  /// This class takes care of the registration of plug-ins in the Wwise engine. Plug-in developers must provide one instance of this class for each plug-in.
1967  /// \sa
1968  /// - \ref soundengine_plugins
1970  {
1971  public:
1973  AkUInt32 /*in_ulCompanyID*/, ///< Plugin company ID.
1974  AkUInt32 /*in_ulPluginID*/ ///< Plugin ID.
1975  )
1976  {
1977  // Placeholder used for plug-in extensions (plug-ins that modify the behavior of an existing plug-in without registering a new ID)
1978  }
1979 
1981  AkPluginType in_eType, ///< Plugin type.
1982  AkUInt32 in_ulCompanyID, ///< Plugin company ID.
1983  AkUInt32 in_ulPluginID, ///< Plugin ID.
1984  AkCreatePluginCallback in_pCreateFunc, ///< Plugin object factory.
1985  AkCreateParamCallback in_pCreateParamFunc, ///< Plugin parameter object factory.
1986  AkGlobalCallbackFunc in_pRegisterCallback = NULL, ///< Optional callback function called after successful plugin registration, with argument AkGlobalCallbackLocation_Register.
1987  void * in_pRegisterCallbackCookie = NULL ///< Optional cookie passed to register callback function above.
1988  )
1990  , m_eType(in_eType)
1991  , m_ulCompanyID(in_ulCompanyID)
1992  , m_ulPluginID(in_ulPluginID)
1993  , m_pCreateFunc(in_pCreateFunc)
1994  , m_pCreateParamFunc(in_pCreateParamFunc)
1995  , m_pFileCreateFunc(NULL) // Legacy
1996  , m_pBankCreateFunc(NULL) // Legacy
1997  , m_pRegisterCallback(in_pRegisterCallback)
1998  , m_pRegisterCallbackCookie(in_pRegisterCallbackCookie)
2000  , m_CodecDescriptor{ nullptr, nullptr, nullptr, nullptr }
2001  {
2002  g_pAKPluginList = this;
2003  }
2004 
2006  AkPluginType in_eType, ///< Plugin type.
2007  AkUInt32 in_ulCompanyID, ///< Plugin company ID.
2008  AkUInt32 in_ulPluginID, ///< Plugin ID.
2009  AkCreatePluginCallback in_pCreateFunc, ///< Plugin object factory.
2010  AkCreateParamCallback in_pCreateParamFunc, ///< Plugin parameter object factory.
2011  AkGetDeviceListCallback in_pGetDeviceListFunc, ///< Plugin parameter object factory.
2012  AkGlobalCallbackFunc in_pRegisterCallback = NULL, ///< Optional callback function called after successful plugin registration, with argument AkGlobalCallbackLocation_Register.
2013  void * in_pRegisterCallbackCookie = NULL ///< Optional cookie passed to register callback function above.
2014  )
2016  , m_eType(in_eType)
2017  , m_ulCompanyID(in_ulCompanyID)
2018  , m_ulPluginID(in_ulPluginID)
2019  , m_pCreateFunc(in_pCreateFunc)
2020  , m_pCreateParamFunc(in_pCreateParamFunc)
2021  , m_pFileCreateFunc(NULL) // Legacy
2022  , m_pBankCreateFunc(NULL) // Legacy
2023  , m_pRegisterCallback(in_pRegisterCallback)
2024  , m_pRegisterCallbackCookie(in_pRegisterCallbackCookie)
2025  , m_pGetDeviceListFunc(in_pGetDeviceListFunc)
2026  , m_CodecDescriptor{ nullptr, nullptr, nullptr, nullptr }
2027  {
2028  g_pAKPluginList = this;
2029  }
2030 
2032  AkUInt32 in_ulCompanyID, ///< Plugin company ID.
2033  AkUInt32 in_ulPluginID, ///< Plugin ID.
2034  AkCreateFileSourceCallback in_pCreateFile, ///< Streamed source factory.
2035  AkCreateBankSourceCallback in_pCreateBank) ///< In-memory source factory.
2038  , m_ulCompanyID(in_ulCompanyID)
2039  , m_ulPluginID(in_ulPluginID)
2040  , m_pCreateFunc(NULL)
2042  , m_pFileCreateFunc(in_pCreateFile) // Legacy
2043  , m_pBankCreateFunc(in_pCreateBank) // Legacy
2047  , m_CodecDescriptor{ in_pCreateFile, in_pCreateBank, nullptr, nullptr }
2048  {
2049  g_pAKPluginList = this;
2050  }
2051 
2053  AkUInt32 in_ulCompanyID, ///< Plugin company ID.
2054  AkUInt32 in_ulPluginID, ///< Plugin ID.
2055  const AkCodecDescriptor &in_Descriptor) ///< Codec descriptor.
2058  , m_ulCompanyID(in_ulCompanyID)
2059  , m_ulPluginID(in_ulPluginID)
2060  , m_pCreateFunc(NULL)
2062  , m_pFileCreateFunc(in_Descriptor.pFileSrcCreateFunc) // Legacy
2063  , m_pBankCreateFunc(in_Descriptor.pBankSrcCreateFunc) // Legacy
2067  , m_CodecDescriptor(in_Descriptor)
2068  {
2069  g_pAKPluginList = this;
2070  }
2071 
2078  AkCreateFileSourceCallback m_pFileCreateFunc; ///< LEGACY: Kept for compatibility with 2019.1. Unused in 2019.2 and up.
2079  AkCreateBankSourceCallback m_pBankCreateFunc; ///< LEGACY: Kept for compatibility with 2019.1. Unused in 2019.2 and up.
2082 
2083  // 2019.2 added parameters
2086  };
2087 }
2088 
2089 #define AK_IMPLEMENT_PLUGIN_FACTORY(_pluginName_, _plugintype_, _companyid_, _pluginid_) \
2090  AK::IAkPlugin* Create##_pluginName_(AK::IAkPluginMemAlloc * in_pAllocator); \
2091  AK::IAkPluginParam * Create##_pluginName_##Params(AK::IAkPluginMemAlloc * in_pAllocator); \
2092  AK_ATTR_USED AK::PluginRegistration _pluginName_##Registration(_plugintype_, _companyid_, _pluginid_, Create##_pluginName_, Create##_pluginName_##Params);
2093 
2094 #define AK_STATIC_LINK_PLUGIN(_pluginName_) \
2095  extern AK::PluginRegistration _pluginName_##Registration; \
2096  void *_pluginName_##_linkonceonly = (void*)&_pluginName_##Registration;
2097 
2098 #define DEFINE_PLUGIN_REGISTER_HOOK AK_DLLEXPORT AK::PluginRegistration * g_pAKPluginList = NULL;
2099 
2100 #ifdef AK_ENABLE_ASSERTS
2101 #define DEFINE_PLUGIN_ASSERT_HOOK \
2102  extern "C" AK_DLLEXPORT AkAssertHook g_pAssertHook; \
2103  AK_DLLEXPORT AkAssertHook g_pAssertHook = NULL;
2104 #else
2105 #define DEFINE_PLUGIN_ASSERT_HOOK
2106 #endif
2107 
2108 /// DEPRECATED: Use DEFINE_PLUGIN_ASSERT_HOOK instead.
2109 #define DEFINEDUMMYASSERTHOOK DEFINE_PLUGIN_ASSERT_HOOK
2110 
2111 #define AK_GET_SINK_TYPE_FROM_DEVICE_KEY(_key) ((AkUInt32)(_key & 0xffffffff))
2112 #define AK_GET_DEVICE_ID_FROM_DEVICE_KEY(_key) ((AkUInt32)(_key >> 32))
2113 
2114 #endif // _IAK_PLUGIN_H_
virtual AkUInt16 GetNumRefillsInVoice()=0
AkPanningRule
Headphone / speakers panning rules
Definition: AkEnums.h:243
Defines the parameters of a marker.
Definition: AkAudioMarker.h:16
Interface to retrieve contextual information for a mixer.
Definition: IAkPlugin.h:486
AkEventCallbackFunc AkCallbackFunc
virtual AKRESULT RegisterAnonymousConfig(AkUInt32 in_uNumChannels, const AkSphericalCoord *in_SphericalPositions)=0
virtual AKRESULT RegisterPlugin(AkPluginType in_eType, AkUInt32 in_ulCompanyID, AkUInt32 in_ulPluginID, AkCreatePluginCallback in_pCreateFunc, AkCreateParamCallback in_pCreateParamFunc)=0
AkCreateFileSourceCallback m_pFileCreateFunc
LEGACY: Kept for compatibility with 2019.1. Unused in 2019.2 and up.
Definition: IAkPlugin.h:2078
virtual AKRESULT Init(IAkPluginMemAlloc *in_pAllocator, IAkSinkPluginContext *in_pSinkPluginContext, IAkPluginParam *in_pParams, AkAudioFormat &io_rFormat)=0
virtual void Consume(AkAudioBuffer *in_pMainMix, AkAudioBuffer *in_pPassthroughMix, const AkAudioObjects &in_objects, AkRamp in_gain)=0
AkConnectionType
Nature of the connection binding an input to a bus.
Definition: AkEnums.h:139
virtual AKRESULT SetRTPCValue(AkRtpcID in_rtpcID, AkRtpcValue in_value, AkGameObjectID in_gameObjectID=AK_INVALID_GAME_OBJECT, AkTimeMs in_uValueChangeDuration=0, AkCurveInterpolation in_eFadeCurve=AkCurveInterpolation_Linear, bool in_bBypassInternalValueInterpolation=false)=0
virtual AkUInt64 RandomSeed() const =0
virtual AkMultiPositionType GetGameObjectMultiPositionType() const =0
uint16_t AkUInt16
Unsigned 16-bit integer
Software plug-in interface for sink (audio end point) which supports 3D audio features.
Definition: IAkPlugin.h:1257
virtual AkUniqueID GetAudioNodeID() const =0
Definition of data structures for AkAudioObject
virtual void ProcessPairedInterpBiquadFilter(AkReal32 **in_ppInputData, AkReal32 **io_ppOutputData, AK::AkBiquadCoefficients **in_ppCoefs1, AK::AkBiquadMemories **io_ppMemories1, AK::AkBiquadCoefficients **in_ppCoefs2, AK::AkBiquadMemories **io_ppMemories2, AkUInt32 *in_pNumSamplesPerInterpStage, AkUInt32 in_uNumInterpStages, AkUInt32 in_uNumChannels)=0
virtual ~IAkPluginParam()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:688
virtual AKRESULT TimeSkip(AkUInt32 in_uFrames)=0
virtual void * GetCookie() const =0
@ PluginServiceType_Markers
Definition: IAkPlugin.h:1400
bool bIsDeviceEffect
Plug-in can process final mixes and objects right before sending them to the audio device for output....
Definition: IAkPlugin.h:82
AkPluginServiceType
Definition: IAkPlugin.h:1394
virtual bool IsStarved()=0
virtual IAkGlobalPluginContext * GlobalContext() const =0
virtual const AkRTPCGraphPoint & GetPoint(const void *in_attenuationCurve, AkUInt32 i) const =0
Get the ith point of the curve.
AK_DLLEXPORT AK::PluginRegistration * g_pAKPluginList
Definition: IAkPlugin.h:92
virtual ~IAkGlobalPluginContext()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:1421
virtual AKRESULT Term(IAkPluginMemAlloc *in_pAllocator)=0
Software effect plug-in interface (see 创建声音引擎效果器插件).
Definition: IAkPlugin.h:824
virtual AKRESULT GetDistanceProbe(AkGameObjectID in_uListener, AkWorldTransform &out_position) const =0
virtual CAkRng CreateRNG() const =0
Advances the internal PRNG seed, and returns a random number generator suitable for DSP processing
virtual AKRESULT PostMonitorData(void *in_pData, AkUInt32 in_uDataSize)=0
virtual AKRESULT Init(IAkPluginMemAlloc *in_pAllocator, IAkEffectPluginContext *in_pEffectPluginContext, IAkPluginParam *in_pParams, AkAudioFormat &io_rFormat)=0
virtual void SetPriorities(AkAudioObject **io_ppObjects, AkUInt32 in_uNumObjects, AkPriority *in_pPriorities)=0
Sets the playback priority of each of the in_uNumObjects audio objects in io_ppObjects from in_pPrior...
@ PluginServiceType_Meter
Definition: IAkPlugin.h:1403
virtual void ProcessPairedBiquadFilter(AkAudioBuffer *in_pInputBuffer, AkAudioBuffer *io_pOutputBuffer, AK::AkBiquadCoefficients *in_pCoefs1, AK::AkBiquadMemories *io_pMemories1, AK::AkBiquadCoefficients *in_pCoefs2, AK::AkBiquadMemories *io_pMemories2, AkUInt32 in_uNumSamples)=0
#define AK_DLLEXPORT
Wwise sound engine source plug-in interface (see 创建声音引擎源插件).
Definition: IAkPlugin.h:1285
virtual AkPanningRule GetPanningRule() const =0
Returns the panning rule for the output device to which the sink plug-in is attached.
virtual AkReal32 GetSpread(AkUInt32 in_uIndex)=0
@ AkPluginTypeNone
Unknown/invalid plug-in type.
Definition: AkEnums.h:282
AkMeteringFlags
Metering flags. Used for specifying bus metering, through AK::SoundEngine::RegisterBusVolumeCallback(...
Definition: AkEnums.h:265
virtual AkUInt16 GetNumLoops() const =0
virtual void EnableMetering(AkMeteringFlags in_eFlags)=0
virtual AKRESULT IsDataNeeded(AkUInt32 &out_uNumFramesNeeded)=0
virtual ~IAkSinkPluginContext()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:1112
virtual IAkMixerPluginContext * GetMixerCtx()=0
virtual bool SupportMediaRelocation() const
Definition: IAkPlugin.h:795
AkCreateParamCallback m_pCreateParamFunc
Definition: IAkPlugin.h:2077
virtual AKRESULT SetParam(AkPluginParamID in_paramID, const void *in_pValue, AkUInt32 in_uParamSize)=0
AkUInt64 AkGameObjectID
Game object ID
Definition: AkTypedefs.h:47
virtual AKRESULT StopMIDIOnEventSync(AkUniqueID in_eventID=AK_INVALID_UNIQUE_ID, AkGameObjectID in_gameObjectID=AK_INVALID_GAME_OBJECT, AkPlayingID in_playingID=AK_INVALID_PLAYING_ID)=0
virtual void MixNinNChannels(AkAudioBuffer *in_pInputBuffer, AkAudioBuffer *in_pMixBuffer, AkReal32 in_fPrevGain, AkReal32 in_fNextGain, AK::SpeakerVolumes::ConstMatrixPtr in_mxPrevVolumes, AK::SpeakerVolumes::ConstMatrixPtr in_mxNextVolumes)=0
N to N channels mix
bool bCanRunOnObjectConfig
Plug-in can run on bus with Audio Object configuration. Effect plug-ins are instantiated once per Aud...
Definition: IAkPlugin.h:83
virtual AkUInt32 GetSampleRate() const =0
virtual void GetPannerPosition(AkVector &out_position)=0
AkCurveInterpolation
Curve interpolation types
Definition: AkEnums.h:185
virtual AKRESULT SendPluginCustomGameData(AkUniqueID in_busID, AkGameObjectID in_busObjectID, AkPluginType in_eType, AkUInt32 in_uCompanyID, AkUInt32 in_uPluginID, const void *in_pData, AkUInt32 in_uSizeInBytes)=0
bool bUsesGainAttribute
Plug-in knows how to process objects separately from the cumulativeGain of the object (or the process...
Definition: IAkPlugin.h:84
Interface to retrieve information about an input of a mix connection (for processing during the Speak...
Definition: IAkPlugin.h:979
AKRESULT(* AkGetDeviceListCallback)(AkUInt32 &io_maxNumDevices, AkDeviceDescription *out_deviceDescriptions)
Registered plugin device enumeration function prototype, used for providing lists of devices by plug-...
Definition: IAkPlugin.h:1383
AkSpeakerPanningType
Speaker panning type: type of panning logic when object is not 3D spatialized (i.e....
Definition: AkEnums.h:222
virtual IAkVoicePluginInfo * GetVoiceInfo()=0
bool bIsInPlace
Buffer usage (in-place or not). If true, and the plug-in is an insert effect, it should implement IAk...
Definition: IAkPlugin.h:78
virtual AkUInt32 GetIDFromString(const char *in_pszString) const =0
AkSinkPluginType
Definition: IAkPlugin.h:1170
virtual AKRESULT ComputeWeightedAmbisonicsDecodingFromSampledSphere(const AkVector in_samples[], AkUInt32 in_uNumSamples, AkChannelConfig in_cfgAmbisonics, AK::SpeakerVolumes::MatrixPtr out_mxVolume)=0
AkCreatePluginCallback m_pCreateFunc
Definition: IAkPlugin.h:2076
Common interface for plug-in services accessed through the global plug-in context
Definition: IAkPlugin.h:1410
virtual ~IAkAudioDeviceEffectPlugin()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:956
Definition: AkRng.h:35
Interface for the "Mixer" plug-in service, to handle mixing together of signals, or applying simple t...
Definition: IAkPlugin.h:1717
virtual ~IAk3DAudioSinkPlugin()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:1260
virtual AkPriority GetPriority() const =0
static const AkGameObjectID AK_INVALID_GAME_OBJECT
Invalid game object (may also mean all game objects)
Definition: AkConstants.h:33
PluginRegistration(AkUInt32, AkUInt32)
Definition: IAkPlugin.h:1972
virtual ~IAkGameObjectPluginInfo()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:108
virtual ~IAkPluginContextBase()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:240
virtual AKRESULT GetSidechainMixChannelConfig(AkUniqueID in_uSidechainId, AkChannelConfig *out_pChannelCfg)=0
PluginRegistration(AkUInt32 in_ulCompanyID, AkUInt32 in_ulPluginID, AkCreateFileSourceCallback in_pCreateFile, AkCreateBankSourceCallback in_pCreateBank)
Definition: IAkPlugin.h:2031
virtual void MixChannel(AkReal32 *AK_RESTRICT in_pInBuffer, AkReal32 *AK_RESTRICT in_pOutBuffer, AkReal32 in_fPrevGain, AkReal32 in_fNextGain, AkUInt16 in_uNumFrames)=0
Single channel mix
virtual AKRESULT ComputePlanarVBAPGains(AkReal32 in_fAngle, AkChannelConfig in_outputConfig, AkReal32 in_fCenterPerc, AK::SpeakerVolumes::VectorPtr out_vVolumes)=0
virtual bool ExtractCurves(IAkPluginMemAlloc *in_pAllocator, const AkAudioObject &in_object, AkUInt32 in_curveTypesMask, void *out_curves[]) const =0
uint8_t AkUInt8
Unsigned 8-bit integer
AkUInt32 AkUniqueID
Unique 32-bit ID
Definition: AkTypedefs.h:39
virtual void GetPluginMedia(AkUInt32 in_dataIndex, AkUInt8 *&out_rpData, AkUInt32 &out_rDataSize)=0
Coefficients to be used for application of digital biquad filters
Definition: AkMixerTypes.h:20
virtual void Execute(AkAudioBuffer *io_pBuffer)=0
PluginRegistration(AkPluginType in_eType, AkUInt32 in_ulCompanyID, AkUInt32 in_ulPluginID, AkCreatePluginCallback in_pCreateFunc, AkCreateParamCallback in_pCreateParamFunc, AkGlobalCallbackFunc in_pRegisterCallback=NULL, void *in_pRegisterCallbackCookie=NULL)
Definition: IAkPlugin.h:1980
virtual IAkProcessorFeatures * GetProcessorFeatures()=0
Return an interface to query processor specific features.
virtual void GetOutputObjects(AkAudioObjects &io_objects)=0
float AkReal32
32-bit floating point
PluginRegistration(AkPluginType in_eType, AkUInt32 in_ulCompanyID, AkUInt32 in_ulPluginID, AkCreatePluginCallback in_pCreateFunc, AkCreateParamCallback in_pCreateParamFunc, AkGetDeviceListCallback in_pGetDeviceListFunc, AkGlobalCallbackFunc in_pRegisterCallback=NULL, void *in_pRegisterCallbackCookie=NULL)
Definition: IAkPlugin.h:2005
@ PluginServiceType_AudioObjectAttenuation
Definition: IAkPlugin.h:1397
Ak3DPositionType
3D position type: defines what acts as the emitter position for computing spatialization against the ...
Definition: AkEnums.h:233
virtual AkUInt16 GetMaxBufferLength() const =0
@ AkSinkPluginType_Sink
Definition: IAkPlugin.h:1171
bool bCanChangeRate
True for effects whose sample throughput is different between input and output. Effects that can chan...
Definition: IAkPlugin.h:79
virtual void Mix1inNChannels(AkReal32 *AK_RESTRICT in_pInChannel, AkAudioBuffer *in_pMixBuffer, AkReal32 in_fPrevGain, AkReal32 in_fNextGain, AK::SpeakerVolumes::ConstVectorPtr in_vPrevVolumes, AK::SpeakerVolumes::ConstVectorPtr in_vNextVolumes)=0
1 to N channels mix
Emitter-listener pair: Positioning data pertaining to a single pair of emitter and listener.
Definition: Ak3DObjects.h:459
virtual bool HasListenerRelativeRouting()=0
Ak3DSpatializationMode
3D spatialization mode.
Definition: AkEnums.h:253
AkPluginInfo()
Constructor for default values
Definition: IAkPlugin.h:64
virtual void Delete(IAkPluginMemAlloc *in_pAllocator, void *&io_attenuationCurve)=0
Free memory of curve obtained with AK::IAkPluginServiceAttenuationCurve::ExtractCurves.
virtual IAkGameObjectPluginInfo * GetGameObjectInfo()=0
virtual bool GetMaxAttenuationDistance(AkReal32 &out_fMaxAttenuationDistance)=0
virtual AKRESULT GetGameObjectPosition(AkUInt32 in_uIndex, AkSoundPosition &out_position) const =0
AkInt16 AkPluginParamID
Source or effect plug-in parameter ID
Definition: AkTypedefs.h:53
virtual AKRESULT GetPluginInfo(AkPluginInfo &out_rPluginInfo)=0
AkUInt32 AkAcousticTextureID
Acoustic Texture ID
Definition: AkTypedefs.h:70
Software interface for sink (audio endpoint) plugins.
Definition: IAkPlugin.h:1233
virtual void SetUserData(void *in_pUserData)=0
virtual bool IsSendModeEffect() const =0
virtual IAkVoicePluginInfo * GetVoiceInfo()=0
virtual void OnFrameEnd()=0
virtual AKRESULT PostMonitorMessage(const char *in_pszError, AK::Monitor::ErrorLevel in_eErrorLevel)=0
Software effect plug-in interface for out-of-place processing (see 创建声音引擎效果器插件).
Definition: IAkPlugin.h:868
AkInt32 AkTimeMs
Time in ms
Definition: AkTypedefs.h:43
virtual AKRESULT SendToSidechainMix(AkUniqueID in_uSidechainId, AkUInt64 in_uSidechainScopeId, AkAudioBuffer *in_pAudioBuffer)=0
virtual ~IAkMixerPluginContext()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:489
virtual AkSinkPluginType GetSinkPluginType() const override final
Definition: IAkPlugin.h:1280
virtual void GetPriorities(AkAudioObject **in_ppObjects, AkUInt32 in_uNumObjects, AkPriority *out_pPriorities)=0
Populates out_pPriorities with playback priorities for objects in in_ppObjects.
@ PluginServiceType_MAX
Definition: IAkPlugin.h:1405
virtual Ak3DSpatializationMode Get3DSpatializationMode()=0
@ PluginServiceType_HashTable
Definition: IAkPlugin.h:1399
virtual AkPlayingID GetPlayingID() const =0
Retrieve the Playing ID of the event corresponding to this voice (if applicable).
Interface for the services related to extracting attenuation curves from audio objects and using them...
Definition: IAkPlugin.h:1846
virtual AKRESULT SubmitMarkerNotifications(const AkAudioMarker *in_pMarkers, const AkUInt32 *in_uOffsetsInBuffer, AkUInt32 in_uNumMarkers)=0
virtual AkReal32 GetFocus(AkUInt32 in_uIndex)=0
Configured audio settings
virtual AKRESULT SignalAudioThread()=0
@ PluginServiceType_RNG
Definition: IAkPlugin.h:1396
virtual AkReal32 GetEnvelope() const
Definition: IAkPlugin.h:1315
virtual void Execute(const AkAudioObjects &io_objects)=0
@ PluginServiceType_WavFileWriter
Definition: IAkPlugin.h:1402
virtual AKRESULT Init(IAkPluginMemAlloc *in_pAllocator, const void *in_pParamsBlock, AkUInt32 in_uBlockSize)=0
AkCodecDescriptor m_CodecDescriptor
Definition: IAkPlugin.h:2085
virtual bool CanPostMonitorData()=0
virtual AkSpeakerPanningType GetSpeakerPanningType()=0
virtual void Execute(AkAudioBuffer *in_pBuffer, AkUInt32 in_uInOffset, AkAudioBuffer *out_pBuffer)=0
virtual AkMIDIEvent GetMidiEvent() const =0
virtual AKRESULT GetSinkChannelConfig(AkChannelConfig &out_sinkConfig, Ak3DAudioSinkCapabilities &out_3dAudioCaps) const =0
@ PluginServiceType_TempAlloc
Definition: IAkPlugin.h:1401
virtual AkUInt32 GetNum3DPositions()=0
AkPluginType eType
Plug-in type
Definition: IAkPlugin.h:76
virtual ~IAkVoicePluginInfo()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:223
Spherical coordinates.
Definition: Ak3DObjects.h:453
AkSpeakerVolumesVectorPtr MatrixPtr
Definition: AkTypedefs.h:104
virtual void Consume(AkAudioBuffer *in_pInputBuffer, AkRamp in_gain)=0
virtual AkUInt32 GetBusType()=0
virtual AkConnectionType GetConnectionType()=0
static const AkPlayingID AK_INVALID_PLAYING_ID
Invalid playing ID
Definition: AkConstants.h:36
virtual AKRESULT ComputeSphericalVBAPGains(void *in_pPannerData, AkReal32 in_fAzimuth, AkReal32 in_fElevation, AkUInt32 in_uNumChannels, AK::SpeakerVolumes::VectorPtr out_vVolumes)=0
virtual AKRESULT InitSphericalVBAP(AK::IAkPluginMemAlloc *in_pAllocator, const AkSphericalCoord *in_SphericalPositions, const AkUInt32 in_NbPoints, void *&out_pPannerData)=0
virtual IAkPluginParam * Clone(IAkPluginMemAlloc *in_pAllocator)=0
AkGetDeviceListCallback m_pGetDeviceListFunc
Definition: IAkPlugin.h:2084
Volume ramp specified by end points "previous" and "next".
AkMultiPositionType
Definition: AkEnums.h:316
AkUInt32 AkPluginID
Source or effect plug-in ID
Definition: AkTypedefs.h:50
Voice-specific information available to plug-ins.
Definition: IAkPlugin.h:220
virtual AkSinkPluginType GetSinkPluginType() const =0
AkReal32 AkRtpcValue
Real time parameter control value
Definition: AkTypedefs.h:61
@ AkPluginTypeCodec
Compressor/decompressor plug-in (allows support for custom audio file types).
Definition: AkEnums.h:283
virtual const AkAcousticTexture * GetAcousticTexture(AkAcousticTextureID in_AcousticTextureID)=0
AkPluginType
Definition: AkEnums.h:281
virtual AKRESULT ComputeSphericalCoordinates(const AkEmitterListenerPair &in_pair, AkReal32 &out_fAzimuth, AkReal32 &out_fElevation) const =0
virtual IAkMarkerNotificationService * CreateMarkerNotificationService(IAkSourcePluginContext *in_pSourcePluginContext)=0
@ PluginServiceType_AudioObjectPriority
Definition: IAkPlugin.h:1398
virtual AKRESULT GetOutputID(AkUInt32 &out_uOutputID, AkPluginID &out_uDevicePlugin) const =0
#define NULL
Definition: AkTypedefs.h:33
virtual AKRESULT Term(IAkPluginMemAlloc *in_pAllocator)=0
virtual AKRESULT TimeSkip(AkUInt32 &)
Definition: IAkPlugin.h:1353
PluginRegistration(AkUInt32 in_ulCompanyID, AkUInt32 in_ulPluginID, const AkCodecDescriptor &in_Descriptor)
Definition: IAkPlugin.h:2052
virtual void Execute(AkAudioBuffer *io_pBuffer)=0
AkUInt32 AkRtpcID
Real time parameter control ID
Definition: AkTypedefs.h:60
void * m_pRegisterCallbackCookie
Definition: IAkPlugin.h:2081
virtual ~IAkSourcePluginContext()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:462
#define AK_CALLBACK(_type, _name)
virtual void * GetUserData()=0
virtual bool GetListeners(AkGameObjectID *out_aListenerIDs, AkUInt32 &io_uSize) const =0
virtual ~IAkPluginServiceRNG()
Definition: IAkPlugin.h:1834
@ AkGlobalCallbackLocation_BeginRender
Start of frame rendering, after having processed game messages.
virtual bool IsRenderingOffline() const =0
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
virtual ~IAkPluginService()
Definition: IAkPlugin.h:1412
virtual AKRESULT GetParentChannelConfig(AkChannelConfig &out_channelConfig) const =0
virtual IAkPluginService * GetPluginService(AkPluginServiceType in_pluginService) const =0
virtual void UnregisterAnonymousConfig(AkUInt32 in_uNumChannels)=0
virtual AKRESULT SetParamsBlock(const void *in_pParamsBlock, AkUInt32 in_uBlockSize)=0
Software effect plug-in interface for in-place processing (see 创建声音引擎效果器插件).
Definition: IAkPlugin.h:844
virtual void Execute(const AkAudioObjects &in_objects, const AkAudioObjects &out_objects)=0
virtual AKRESULT Init(IAkPluginMemAlloc *in_pAllocator, IAkAudioDeviceEffectPluginContext *in_pEffectPluginContext, IAkPluginParam *in_pParams, const AkAudioFormat &in_rFormat, const Ak3DAudioSinkCapabilities &in_3dCapabilities)=0
virtual AkReal32 GetGameObjectScaling() const =0
virtual void ResetStarved()=0
Reset the "starvation" flag after IsStarved() returned true.
virtual AKRESULT RelocateMedia(AkUInt8 *, AkUInt8 *)
Definition: IAkPlugin.h:812
@ PluginServiceType_Mixer
Definition: IAkPlugin.h:1395
virtual void SetOutputDeviceInfoCustomData(void *in_pCustomData)=0
AkSpeakerVolumesConstVectorPtr ConstVectorPtr
Definition: AkTypedefs.h:105
virtual IAkVoicePluginInfo * GetVoiceInfo()=0
virtual AKRESULT ComputeSpeakerVolumesDirect(AkChannelConfig in_inputConfig, AkChannelConfig in_outputConfig, AkReal32 in_fCenterPerc, AK::SpeakerVolumes::MatrixPtr out_mxVolumes)=0
virtual AkReal32 GetDownstreamGain()=0
virtual AkReal32 Evaluate(void *&io_attenuationCurve, AkReal32 x)=0
Evaluate the value of a curve at given x coordinate.
bool bReserved
Legacy bIsAsynchronous plug-in flag, now unused. Preserved for plug-in backward compatibility....
Definition: IAkPlugin.h:80
Positioning data of 3D audio objects.
Definition: AkCommonDefs.h:278
AKRESULT
Definition: AkEnums.h:32
A collection of audio objects. Encapsulates the audio data and metadata of each audio object in separ...
uint64_t AkUInt64
Unsigned 64-bit integer
virtual AKRESULT TimeSkip(AkUInt32 &io_uFrames)=0
virtual IAkGameObjectPluginInfo * GetGameObjectInfo()=0
virtual AKRESULT ComputePositioning(const AkPositioningData &in_posData, AkChannelConfig in_inputConfig, AkChannelConfig in_outputConfig, AK::SpeakerVolumes::MatrixPtr out_mxVolumes)=0
virtual AKRESULT UnregisterGlobalCallback(AkGlobalCallbackFunc in_pCallback, AkUInt32 in_eLocation=AkGlobalCallbackLocation_BeginRender)=0
virtual void ApplyGain(AkAudioBuffer *in_pInputBuffer, AkAudioBuffer *in_pOutputBuffer, AkRamp in_gain, bool in_convertToInt16) const =0
AkUInt32 uBuildVersion
Plug-in build version, must match the AK_WWISESDK_VERSION_COMBINED macro from AkWwiseSDKVersion....
Definition: IAkPlugin.h:77
void(* AkGlobalCallbackFunc)(AkGlobalPluginContextPtr in_pContext, enum AkGlobalCallbackLocation in_eLocation, void *in_pCookie)
virtual AKRESULT Reset()=0
AK::IAkPluginParam *(* AkCreateParamCallback)(AK::IAkPluginMemAlloc *in_pAllocator)
Registered plugin parameter node creation function prototype.
Definition: IAkPlugin.h:1381
virtual void Get3DAudioCapabilities(Ak3DAudioSinkCapabilities &out_rCapabilities)=0
Returns the capabilities of the sink's 3D audio system
virtual ~IAkEffectPlugin()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:827
@ AkCurveInterpolation_Linear
Linear (Default)
Definition: AkEnums.h:192
virtual ~IAkSinkPlugin()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:1236
virtual AkUniqueID GetAttenuation(const AkAudioObject &in_object, AkReal32 &out_distanceScaling) const =0
virtual AKRESULT GetAudioSettings(AkAudioSettings &out_audioSettings) const =0
AkSpeakerVolumesConstMatrixPtr ConstMatrixPtr
Definition: AkTypedefs.h:106
virtual IAkPlatformContext * GetPlatformContext() const =0
virtual AKRESULT StopLooping()
Definition: IAkPlugin.h:1329
virtual AkReal32 GetCenterPerc()=0
PluginRegistration * pNext
Definition: IAkPlugin.h:2072
virtual AkPlayingID PostEventSync(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)=0
virtual AKRESULT ComputePositioning(const AkPositioningData &in_posData, AkChannelConfig in_inputConfig, AkChannelConfig in_outputConfig, AK::SpeakerVolumes::MatrixPtr out_mxVolumes)=0
virtual ~IAkPluginServiceMarkers()
Definition: IAkPlugin.h:1928
virtual void ApplyGainAndInterleave(AkAudioBuffer *in_pInputBuffer, AkAudioBuffer *in_pOutputBuffer, AkRamp in_gain, bool in_convertToInt16) const =0
virtual AKRESULT Get3DPosition(AkUInt32 in_uIndex, AkEmitterListenerPair &out_soundPosition)=0
virtual ~IAkSourcePlugin()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:1288
static const AkUniqueID AK_INVALID_UNIQUE_ID
Invalid unique 32-bit ID
Definition: AkConstants.h:34
@ PluginServiceType_PlatformFuncs
Definition: IAkPlugin.h:1404
virtual AkSinkPluginType GetSinkPluginType() const override final
Definition: IAkPlugin.h:1252
virtual AKRESULT ReceiveFromSidechainMix(AkUniqueID in_uSidechainId, AkUInt64 in_uSidechainScopeId, AkAudioBuffer *io_pAudioBuffer)=0
Position and orientation of game objects in the world (i.e. supports 64-bit-precision position)
Definition: Ak3DObjects.h:134
Type for a point in an RTPC or Attenuation curve.
uint32_t AkUInt32
Unsigned 32-bit integer
virtual ~IAkPlugin()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:759
virtual AKRESULT GetEmitterListenerPair(AkUInt32 in_uIndex, AkEmitterListenerPair &out_emitterListenerPair) const =0
Definition: AkMidiTypes.h:235
Game object information available to plugins.
Definition: IAkPlugin.h:105
virtual void ProcessBiquadFilter(AkAudioBuffer *in_pInputBuffer, AkAudioBuffer *io_pOutputBuffer, AK::AkBiquadCoefficients *in_pCoefs, AK::AkBiquadMemories *io_pMemories, AkUInt32 in_uNumSamples)=0
virtual AK::IAkPluginMemAlloc * GetAllocator()=0
Get the default allocator for plugins. This is useful for performing global initialization tasks shar...
virtual AKRESULT Compute3DPositioning(const AkWorldTransform &in_emitter, const AkWorldTransform &in_listener, AkReal32 in_fCenterPerc, AkReal32 in_fSpread, AkReal32 in_fFocus, AkChannelConfig in_inputConfig, AkChannelMask in_uInputChanSel, AkChannelConfig in_outputConfig, AK::SpeakerVolumes::MatrixPtr out_mxVolumes)=0
virtual AKRESULT CreateOutputObjects(AkChannelConfig in_channelConfig, AkAudioObjects &io_objects)=0
virtual AKRESULT Init(IAkPluginMemAlloc *in_pAllocator, IAkSourcePluginContext *in_pSourcePluginContext, IAkPluginParam *in_pParams, AkAudioFormat &io_rFormat)=0
3D vector for some operations in 3D space. Typically intended only for localized calculations due to ...
Definition: Ak3DObjects.h:71
Interface for the markers service.
Definition: IAkPlugin.h:1926
virtual AKRESULT Seek(AkUInt32)
Definition: IAkPlugin.h:1343
virtual ~IAkEffectPluginContext()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:373
virtual AkGameObjectID GetGameObjectID() const =0
Get the ID of the game object.
AkInt8 AkPriority
Priority
Definition: AkTypedefs.h:54
@ AkSinkPluginType_3DAudioSink
Definition: IAkPlugin.h:1172
virtual const AkPlatformInitSettings * GetPlatformInitSettings() const =0
AkGlobalCallbackFunc m_pRegisterCallback
Definition: IAkPlugin.h:2080
virtual bool IsPrimary()=0
"Memories" storing the previous state of the digital biquad filter
Definition: AkMixerTypes.h:45
virtual void TerminateMarkerNotificationService(IAkMarkerNotificationService *io_pMarkerNotificationService)=0
virtual AKRESULT ComputeSpeakerVolumesPanner(AkSpeakerPanningType in_ePannerType, const AkVector &in_position, AkReal32 in_fCenterPct, AkChannelConfig in_inputConfig, AkChannelConfig in_outputConfig, AK::SpeakerVolumes::MatrixPtr out_mxVolumes)=0
Listener information.
Definition: Ak3DObjects.h:555
virtual AkUInt32 GetBufferTick() const =0
virtual const AkInitSettings * GetInitSettings() const =0
@ AK_NotImplemented
This feature is not implemented.
Definition: AkEnums.h:33
virtual AKRESULT PostMonitorMessage(const char *in_pszError, AK::Monitor::ErrorLevel in_eErrorLevel)=0
AkUInt32 AkChannelMask
Channel mask (similar to extensibleWavFormat). Bit values are defined in AkSpeakerConfig....
Definition: AkTypedefs.h:68
bool bCanProcessObjects
Plug-in can process audio objects. They must implement IAkInPlaceObjectPlugin or IAkOutOfPlaceObjectP...
Definition: IAkPlugin.h:81
@ AK_Success
The operation was successful.
Definition: AkEnums.h:34
virtual AkUInt32 GetNumPoints(const void *in_attenuationCurve) const =0
Get the number of points on a curve.
virtual void ProcessInterpBiquadFilter(AkReal32 **in_ppInputData, AkReal32 **io_ppOutputData, AK::AkBiquadCoefficients **in_ppCoefs, AK::AkBiquadMemories **io_ppMemories, AkUInt32 *in_pNumSamplesPerInterpStage, AkUInt32 in_uNumInterpStages, AkUInt32 in_uNumChannels)=0
virtual void Execute(AkAudioBuffer *io_pMainMix, AkAudioBuffer *io_pPassthroughMix, const AkAudioObjects &io_objects, AkRamp &io_gain)=0
static const AkPluginParamID ALL_PLUGIN_DATA_ID
Definition: IAkPlugin.h:749
virtual AkPlayingID PostMIDIOnEventSync(AkUniqueID in_eventID, AkGameObjectID in_gameObjectID, AkMIDIPost *in_pPosts, AkUInt16 in_uNumPosts, bool in_bAbsoluteOffsets=false, AkUInt32 in_uFlags=0, AkCallbackFunc in_pfnCallback=NULL, void *in_pCookie=NULL, AkPlayingID in_playingID=AK_INVALID_PLAYING_ID)=0
AkPluginType m_eType
Definition: IAkPlugin.h:2073
virtual AKRESULT GetOutputDeviceInfo(AkOutputDeviceInfo &out_outputDeviceInfo) const =0
ErrorLevel
ErrorLevel
virtual AKRESULT TermSphericalVBAP(AK::IAkPluginMemAlloc *in_pAllocator, void *in_pPannerData)=0
virtual AkUInt32 GetNumEmitterListenerPairs() const =0
virtual ~IAkPluginServiceMixer()
Definition: IAkPlugin.h:1719
AK::IAkPlugin *(* AkCreatePluginCallback)(AK::IAkPluginMemAlloc *in_pAllocator)
Registered plugin creation function prototype.
Definition: IAkPlugin.h:1379
Defines the parameters of an audio buffer format.
Definition: AkCommonDefs.h:61
virtual Ak3DPositionType Get3DPositionType()=0
IAkSoftwareCodec *(* AkCreateBankSourceCallback)(void *in_pCtx)
Registered bank source node creation function prototype.
virtual AKRESULT RegisterCodec(AkUInt32 in_ulCompanyID, AkUInt32 in_ulPluginID, AkCreateFileSourceCallback in_pFileCreateFunc, AkCreateBankSourceCallback in_pBankCreateFunc)=0
virtual void ComputeAmbisonicsEncoding(AkReal32 in_fAzimuth, AkReal32 in_fElevation, AkChannelConfig in_cfgAmbisonics, AK::SpeakerVolumes::VectorPtr out_vVolumes)=0
AkSpeakerVolumesMatrixPtr VectorPtr
Definition: AkTypedefs.h:103
AkUInt32 AkPlayingID
A unique identifier generated whenever a PostEvent is called (or when a Dynamic Sequence is created)....
Definition: AkTypedefs.h:42
virtual AkReal32 GetDuration() const =0
virtual AKRESULT GetSpeakerAngles(AkReal32 *io_pfSpeakerAngles, AkUInt32 &io_uNumAngles, AkReal32 &out_fHeightAngle)=0
virtual void Linearize(void *&io_attenuationCurve)=0
Some curves are serialized in the log domain. Use this function to convert all the points to linear a...
#define AK_RESTRICT
Refers to the __restrict compilation flag available on some platforms
Definition: AkTypes.h:45
virtual AKRESULT RegisterGlobalCallback(AkPluginType in_eType, AkUInt32 in_ulCompanyID, AkUInt32 in_ulPluginID, AkGlobalCallbackFunc in_pCallback, AkUInt32 in_eLocation=AkGlobalCallbackLocation_BeginRender, void *in_pCookie=NULL)=0
IAkSoftwareCodec *(* AkCreateFileSourceCallback)(void *in_pCtx)
Registered file source creation function prototype.
virtual void GetPluginCustomGameData(void *&out_rpData, AkUInt32 &out_rDataSize)=0
Interface to retrieve contextual information available to all types of plugins.
Definition: IAkPlugin.h:237
virtual AKRESULT ComputePositioning(const AkPositioningData &in_posData, AkChannelConfig in_inputConfig, AkChannelConfig in_outputConfig, AK::SpeakerVolumes::MatrixPtr out_mxVolumes)=0
AkCreateBankSourceCallback m_pBankCreateFunc
LEGACY: Kept for compatibility with 2019.1. Unused in 2019.2 and up.
Definition: IAkPlugin.h:2079
virtual AKRESULT GetListenerData(AkGameObjectID in_uListener, AkListener &out_listener) const =0
virtual AkUInt32 GetNumGameObjectPositions() const =0
virtual IAkStreamMgr * GetStreamMgr() const =0
Retrieve the streaming manager access interface.

此页面对您是否有帮助?

需要技术支持?

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

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

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

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

开始 Wwise 之旅