Version
menu

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

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise