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