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

Was this page helpful?

Need Support?

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

Visit our Support page

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

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

Get started with Wwise