Version
menu_open
link
Wwise SDK 2018.1.11
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>
45 #include <AK/AkWwiseSDKVersion.h>
46 
47 #include <math.h>
48 
49 #if defined AK_CPU_X86 || defined AK_CPU_X86_64
50 #include <xmmintrin.h>
51 #endif
52 
53 /// Plug-in information structure.
54 /// \remarks The bIsInPlace field is only relevant for effect plug-ins.
55 /// \sa
56 /// - \ref iakeffect_geteffectinfo
57 struct AkPluginInfo
58 {
59  /// Constructor for default values
62  , uBuildVersion( 0 )
63  , bIsInPlace(true)
64  , bCanChangeRate(false)
65  , bReserved(false)
66  {}
67 
68  AkPluginType eType; ///< Plug-in type
69  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.
70  bool bIsInPlace; ///< Buffer usage (in-place or not)
71  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.
72  bool bReserved; ///< Legacy bIsAsynchronous plug-in flag, now unused. Preserved for plug-in backward compatibility. bReserved should be false for all plug-in.
73 };
74 
75 //Forward declarations.
76 namespace AK
77 {
78  class PluginRegistration;
79 }
81 
82 struct AkAcousticTexture;
83 
84 namespace AK
85 {
86  class IAkStreamMgr;
87  class IAkGlobalPluginContext;
88 
89  /// Game object information available to plugins.
91  {
92  protected:
93  /// Virtual destructor on interface to avoid warnings.
95 
96  public:
97 
98  /// Get the ID of the game object.
99  virtual AkGameObjectID GetGameObjectID() const = 0;
100 
101  /// Retrieve the number of emitter-listener pairs (rays) of the game object.
102  /// A game object may have more than one position, and be listened to more than one listener.
103  /// The returned value is the product of these two numbers. Use the returned value as a higher
104  /// bound for the index of GetEmitterListenerPair().
105  /// Note that rays whose listener is irrelevant to the current context are ignored. For example,
106  /// if the calling plug-in exists on a bus, only listeners that are routed to the end point's
107  /// device are considered.
108  /// \sa
109  /// - AK::SoundEngine::SetPosition()
110  /// - AK::SoundEngine::SetMultiplePositions()
111  /// - AK::SoundEngine::SetListeners()
112  /// - AK::IAkGameObjectPluginInfo::GetEmitterListenerPair()
113  /// - AK::SoundEngine::AddSecondaryOutput()
114  virtual AkUInt32 GetNumEmitterListenerPairs() const = 0;
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()
185  virtual AKRESULT GetListenerData(
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.
237  virtual AKRESULT GetOutputID(
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.
274  virtual AKRESULT PostMonitorData(
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.
301  virtual AkReal32 GetDownstreamGain() = 0;
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 out_channelConfig.IsValid() == false 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.
336  virtual IAkVoicePluginInfo * GetVoiceInfo() = 0;
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.
367  virtual IAkVoicePluginInfo * GetVoiceInfo() = 0;
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()
428  virtual AKRESULT 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.
439  AkChannelConfig in_inputConfig, ///< Channel configuration of the input.
440  AkChannelConfig in_outputConfig, ///< Channel configuration of the mixer output.
441  AkReal32 in_fCenterPerc, ///< Center percentage. Only applies to mono inputs with standard output configurations that have a center channel.
442  AK::SpeakerVolumes::MatrixPtr out_mxVolumes ///< Returned volumes matrix. Must be preallocated using AK::SpeakerVolumes::Matrix::GetRequiredSize() (see AK::SpeakerVolumes::Matrix services).
443  ) = 0;
444 
445  /// Compute a volume matrix given the position of the panner (Wwise 2D panner).
447  const AkVector & in_position, ///< x,y,z panner position [-1,1]. Note that z has no effect at the moment.
448  AkReal32 in_fCenterPct, ///< Center percentage.
449  AkChannelConfig in_inputConfig, ///< Channel configuration of the input.
450  AkChannelConfig in_outputConfig, ///< Channel configuration of the mixer output.
451  AK::SpeakerVolumes::MatrixPtr out_mxVolumes ///< Returned volumes matrix. Must be preallocated using AK::SpeakerVolumes::Matrix::GetRequiredSize() (see AK::SpeakerVolumes::Matrix services).
452  ) = 0;
453 
454  /// Compute panning gains on the plane given an incidence angle and channel configuration.
455  /// \return AK_Success if successful, AK_Fail otherwise.
457  AkReal32 in_fAngle, ///< Incident angle, in radians [-pi,pi], where 0 is the azimuth (positive values are clockwise)
458  AkChannelConfig in_outputConfig, ///< Desired output configuration.
459  AkReal32 in_fCenterPerc, ///< Center percentage. Only applies to mono inputs to outputs that have no center.
460  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.
461  ) = 0;
462 
463  /// Initialize spherical VBAP
464  /// \return AK_Success if successful, AK_Fail otherwise.
465  virtual AKRESULT InitSphericalVBAP(
466  AK::IAkPluginMemAlloc* in_pAllocator, ///< Memory allocator
467  const AkSphericalCoord* in_SphericalPositions, ///< Array of points in spherical coordinate, representign the virtual position of each channels.
468  const AkUInt32 in_NbPoints, ///< Number of points in the position array
469  void *& out_pPannerData ///< Contains data relevant to the 3D panner that shoud be re-used accross plugin instances.
470  ) = 0;
471 
472  /// Compute panning gains on the plane given an incidence angle and channel configuration.
473  /// \return AK_Success if successful, AK_Fail otherwise.
475  void* in_pPannerData, ///< Contains data relevant to the 3D panner that shoud be re-used accross plugin instances.
476  AkReal32 in_fAzimuth, ///< Incident angle, in radians [-pi,pi], where 0 is the azimuth (positive values are clockwise)
477  AkReal32 in_fElevation, ///< Incident angle, in radians [0,pi], where 0 is the elevation (positive values are clockwise)
478  AkUInt32 in_uNumChannels, ///< Number of output channels.
479  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.
480  ) = 0;
481 
482  /// Clear panner data obtained from InitSphericalVBAP().
483  /// \return AK_Success if successful, AK_Fail otherwise.
484  virtual AKRESULT TermSphericalVBAP(
485  AK::IAkPluginMemAlloc* in_pAllocator, ///< Memory allocator
486  void* in_pPannerData ///< Contains data relevant to the 3D panner that shoud be re-used accross plugin instances.
487  ) = 0;
488 
489  /// Compute standard 3D positioning.
490  /// \return AK_Success if successful.
491  /// \aknote The cartesian counterpart of Compute3DPositioning, that uses emitter and listener transforms, should be used instead of this function.
492  /// It is more complete and more efficient. \endaknote
494  AkReal32 in_fAngle, ///< Incident angle, in radians [-pi,pi], where 0 is the azimuth (positive values are clockwise).
495  AkReal32 in_fElevation, ///< Incident elevation angle, in radians [-pi/2,pi/2], where 0 is the horizon (positive values are above the horizon).
496  AkReal32 in_fSpread, ///< Spread ([0,100]).
497  AkReal32 in_fFocus, ///< Focus ([0,100]).
498  AkChannelConfig in_inputConfig, ///< Channel configuration of the input.
499  AkChannelMask in_uInputChanSel, ///< Mask of input channels selected for panning (excluded input channels don't contribute to the output).
500  AkChannelConfig in_outputConfig, ///< Desired output configuration.
501  AkReal32 in_fCenterPerc, ///< Center percentage. Only applies to mono inputs to outputs that have a center.
502  AK::SpeakerVolumes::MatrixPtr out_mxVolumes ///< Returned volumes matrix. Must be preallocated using AK::SpeakerVolumes::Matrix::GetRequiredSize() (see AK::SpeakerVolumes::Matrix services).
503  ) = 0;
504 
505  /// Compute standard 3D positioning.
506  /// \return AK_Success if successful.
507  /// \aknote This function is more complete and more efficient than the Compute3DPositioning service that uses spherical coordinates, and should be favored.\endaknote
509  const AkTransform & in_emitter, ///< Emitter transform.
510  const AkTransform & in_listener, ///< Listener transform.
511  AkReal32 in_fCenterPerc, ///< Center percentage. Only applies to mono inputs to outputs that have a center.
512  AkReal32 in_fSpread, ///< Spread.
513  AkReal32 in_fFocus, ///< Focus.
514  AkChannelConfig in_inputConfig, ///< Channel configuration of the input.
515  AkChannelMask in_uInputChanSel, ///< Mask of input channels selected for panning (excluded input channels don't contribute to the output).
516  AkChannelConfig in_outputConfig, ///< Desired output configuration.
517  AK::SpeakerVolumes::MatrixPtr out_mxVolumes ///< Returned volumes matrix. Must be preallocated using AK::SpeakerVolumes::Matrix::GetRequiredSize() (see AK::SpeakerVolumes::Matrix services).
518  ) = 0;
519 
520  //@}
521 
522  /// \name Metering.
523  //@{
524 
525  /// Set flags for controlling computation of metering values on the mix buffer.
526  /// Pass AK_NoMetering to disable metering.
527  /// \sa
528  /// - AK::IAkMetering
529  virtual void EnableMetering( AkMeteringFlags in_eFlags ) = 0;
530 
531  //@}
532  };
533 
534  /// Parameter node interface, managing access to an enclosed parameter structure.
535  /// \aknote The implementer of this interface should also expose a static creation function
536  /// that will return a new parameter node instance when required (see \ref se_plugins_overview). \endaknote
537  /// \sa
538  /// - \ref shared_parameter_interface
540  {
541  protected:
542  /// Virtual destructor on interface to avoid warnings.
543  virtual ~IAkPluginParam(){}
544 
545  public:
546  /// Create a duplicate of the parameter node instance in its current state.
547  /// \aknote The allocation of the new parameter node should be done through the AK_PLUGIN_NEW() macro. \endaknote
548  /// \return Pointer to a duplicated plug-in parameter node interface
549  /// \sa
550  /// - \ref iakeffectparam_clone
551  virtual IAkPluginParam * Clone(
552  IAkPluginMemAlloc * in_pAllocator ///< Interface to memory allocator to be used
553  ) = 0;
554 
555  /// Initialize the plug-in parameter node interface.
556  /// Initializes the internal parameter structure to default values or with the provided parameter
557  /// block if it is valid. \endaknote
558  /// \aknote If the provided parameter block is valid, use SetParamsBlock() to set all parameters at once. \endaknote
559  /// \return Possible return values are: AK_Success, AK_Fail, AK_InvalidParameter
560  /// \sa
561  /// - \ref iakeffectparam_init
562  virtual AKRESULT Init(
563  IAkPluginMemAlloc * in_pAllocator, ///< Interface to the memory allocator to be used
564  const void * in_pParamsBlock, ///< Pointer to a parameter structure block
565  AkUInt32 in_uBlockSize ///< Size of the parameter structure block
566  ) = 0;
567 
568  /// Called by the sound engine when a parameter node is terminated.
569  /// \aknote The self-destruction of the parameter node must be done using the AK_PLUGIN_DELETE() macro. \endaknote
570  /// \return AK_Success if successful, AK_Fail otherwise
571  /// \sa
572  /// - \ref iakeffectparam_term
573  virtual AKRESULT Term(
574  IAkPluginMemAlloc * in_pAllocator ///< Interface to memory allocator to be used
575  ) = 0;
576 
577  /// Set all plug-in parameters at once using a parameter block.
578  /// \return AK_Success if successful, AK_InvalidParameter otherwise
579  /// \sa
580  /// - \ref iakeffectparam_setparamsblock
581  virtual AKRESULT SetParamsBlock(
582  const void *in_pParamsBlock, ///< Pointer to a parameter structure block
583  AkUInt32 in_uBlockSize ///< Size of the parameter structure block
584  ) = 0;
585 
586  /// Update a single parameter at a time and perform the necessary actions on the parameter changes.
587  /// \aknote The parameter ID corresponds to the AudioEnginePropertyID in the plug-in XML description file. \endaknote
588  /// \return AK_Success if successful, AK_InvalidParameter otherwise
589  /// \sa
590  /// - \ref iakeffectparam_setparam
591  virtual AKRESULT SetParam(
592  AkPluginParamID in_paramID, ///< ID number of the parameter to set
593  const void * in_pValue, ///< Pointer to the value of the parameter to set
594  AkUInt32 in_uParamSize ///< Size of the value of the parameter to set
595  ) = 0;
596 
597  /// Use this constant with AK::Wwise::IPluginPropertySet::NotifyInternalDataChanged,
598  /// AK::Wwise::IAudioPlugin::GetPluginData and IAkPluginParam::SetParam. This tells
599  /// that the whole plugin data needs to be saved/transferred.
600  ///\sa
601  /// - AK::Wwise::IPluginPropertySet::NotifyInternalDataChanged
602  /// - AK::Wwise::IAudioPlugin::GetPluginData
603  /// - AK::IAkPluginParam::SetParam
604  static const AkPluginParamID ALL_PLUGIN_DATA_ID = 0x7FFF;
605  };
606 
607  /// Wwise sound engine plug-in interface. Shared functionality across different plug-in types.
608  /// \aknote The implementer of this interface should also expose a static creation function
609  /// that will return a new plug-in instance when required (see \ref soundengine_plugins). \endaknote
610  class IAkPlugin
611  {
612  protected:
613  /// Virtual destructor on interface to avoid warnings.
614  virtual ~IAkPlugin(){}
615 
616  public:
617  /// Release the resources upon termination of the plug-in.
618  /// \return AK_Success if successful, AK_Fail otherwise
619  /// \aknote The self-destruction of the plug-in must be done using AK_PLUGIN_DELETE() macro. \endaknote
620  /// \sa
621  /// - \ref iakeffect_term
622  virtual AKRESULT Term(
623  IAkPluginMemAlloc * in_pAllocator ///< Interface to memory allocator to be used by the plug-in
624  ) = 0;
625 
626  /// The reset action should perform any actions required to reinitialize the state of the plug-in
627  /// to its original state (e.g. after Init() or on effect bypass).
628  /// \return AK_Success if successful, AK_Fail otherwise.
629  /// \sa
630  /// - \ref iakeffect_reset
631  virtual AKRESULT Reset() = 0;
632 
633  /// Plug-in information query mechanism used when the sound engine requires information
634  /// about the plug-in to determine its behavior
635  /// \return AK_Success if successful.
636  /// \sa
637  /// - \ref iakeffect_geteffectinfo
638  virtual AKRESULT GetPluginInfo(
639  AkPluginInfo & out_rPluginInfo ///< Reference to the plug-in information structure to be retrieved
640  ) = 0;
641 
642  /// Some plug-ins are accessing Media from the Wwise sound bank system.
643  /// If the IAkPlugin object is not using media, this function will not be used and should simply return false.
644  /// If the IAkPlugin object is using media, the RelocateMedia feature can be optionally implemented.
645  /// 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)
646  ///
647  /// \sa
648  /// - AK::IAkPlugin::RelocateMedia
649  virtual bool SupportMediaRelocation() const
650  {
651  return false;
652  }
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.
656  /// If the IAkPlugin object is using media, the RelocateMedia feature can be optionally implemented.
657  /// When this function is being called, the IAkPlugin object must make the required changes to remove all
658  /// 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.
659  /// The change must be done within the function RelocateMedia().
660  /// After this call, the memory space in in_pOldInMemoryData will be invalidated and cannot be used safely anymore.
661  ///
662  /// This function will not be called if SupportMediaRelocation returned false.
663  ///
664  /// \sa
665  /// - AK::IAkPlugin::SupportMediaRelocation
667  AkUInt8* /*in_pNewMedia*/,
668  AkUInt8* /*in_pOldMedia*/
669  )
670  {
671  return AK_NotImplemented;
672  }
673 
674  };
675 
676  /// Software effect plug-in interface (see \ref soundengine_plugins_effects).
677  class IAkEffectPlugin : public IAkPlugin
678  {
679  protected:
680  /// Virtual destructor on interface to avoid warnings.
681  virtual ~IAkEffectPlugin(){}
682 
683  public:
684  /// Software effect plug-in initialization. Prepares the effect for data processing, allocates memory and sets up the initial conditions.
685  /// \aknote Memory allocation should be done through appropriate macros (see \ref fx_memory_alloc). \endaknote
686  /// \sa
687  /// - \ref iakmonadiceffect_init
688  virtual AKRESULT Init(
689  IAkPluginMemAlloc * in_pAllocator, ///< Interface to memory allocator to be used by the effect
690  IAkEffectPluginContext * in_pEffectPluginContext, ///< Interface to effect plug-in's context
691  IAkPluginParam * in_pParams, ///< Interface to plug-in parameters
692  AkAudioFormat & io_rFormat ///< Audio data format of the input/output signal. Only an out-of-place plugin is allowed to change the channel configuration.
693  ) = 0;
694  };
695 
696  /// Software effect plug-in interface for in-place processing (see \ref soundengine_plugins_effects).
698  {
699  public:
700  /// Software effect plug-in DSP execution for in-place processing.
701  /// \aknote The effect should process all the input data (uValidFrames) as long as AK_DataReady is passed in the eState field.
702  /// When the input is finished (AK_NoMoreData), the effect can output more sample than uValidFrames up to MaxFrames() if desired.
703  /// All sample frames beyond uValidFrames are not initialized and it is the responsibility of the effect to do so when outputting an effect tail.
704  /// The effect must notify the pipeline by updating uValidFrames if more frames are produced during the effect tail.
705  /// \aknote The effect will stop being called by the pipeline when AK_NoMoreData is returned in the the eState field of the AkAudioBuffer structure.
706  /// See \ref iakmonadiceffect_execute_general.
707  virtual void Execute(
708  AkAudioBuffer * io_pBuffer ///< In/Out audio buffer data structure (in-place processing)
709  ) = 0;
710 
711  /// Skips execution of some frames, when the voice is virtual playing from elapsed time.
712  /// This can be used to simulate processing that would have taken place (e.g. update internal state).
713  /// Return AK_DataReady or AK_NoMoreData, depending if there would be audio output or not at that point.
714  virtual AKRESULT TimeSkip(
715  AkUInt32 in_uFrames ///< Number of frames the audio processing should advance.
716  ) = 0;
717  };
718 
719 
720  /// Software effect plug-in interface for out-of-place processing (see \ref soundengine_plugins_effects).
722  {
723  public:
724  /// Software effect plug-in for out-of-place processing.
725  /// \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).
726  /// 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.
727  /// AK_DataNeeded should be used when more input data is necessary to continue processing.
728  /// \aknote Only the output buffer eState field is looked at by the pipeline to determine the effect state.
729  /// See \ref iakmonadiceffect_execute_outofplace.
730  virtual void Execute(
731  AkAudioBuffer * in_pBuffer, ///< Input audio buffer data structure
732  AkUInt32 in_uInOffset, ///< Offset position into input buffer data
733  AkAudioBuffer * out_pBuffer ///< Output audio buffer data structure
734  ) = 0;
735 
736  /// Skips execution of some frames, when the voice is virtual playing from elapsed time.
737  /// This can be used to simulate processing that would have taken place (e.g. update internal state).
738  /// Return AK_DataReady or AK_NoMoreData, depending if there would be audio output or not at that point.
739  virtual AKRESULT TimeSkip(
740  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.
741  ) = 0;
742  };
743 
744  /// Interface to retrieve information about an input of a mixer.
746  {
747  protected:
748  /// Virtual destructor on interface to avoid warnings.
750 
751  public:
752 
753  /// Obtain the parameter blob for the mixer plugin that were attached to this input.
754  /// \return The parameter blob, which can be safely cast into the plugin's implementation.
755  /// If all parameters are default value, NULL is returned. It is up to the plugin's implementation to know
756  /// what the default values are.
757  virtual IAkPluginParam * GetInputParam() = 0;
758 
759  /// Obtain the interface to access the voice info of this input.
760  /// \return The interface to voice info. NULL when the input is not a voice but the output of another bus instead.
761  virtual IAkVoicePluginInfo * GetVoiceInfo() = 0;
762 
763  /// Query the nature of the connection between this input and the mixer.
764  /// \return The connection type (direct/dry, user-defined auxiliary send, game-defined auxiliary send). Bus inputs are always "direct".
765  virtual AkConnectionType GetConnectionType() = 0;
766 
767  /// Get internal ID of sound associated to this input.
768  /// In the case of a voice, the ID is internal but corresponds to what you would get from the duration
769  /// callback (see AkDurationCallbackInfo::audioNodeID). In the case of a bus, it can be matched with the bus name converted
770  /// to a unique ID using AK::SoundEngine::GetIDFromString().
771  /// \return ID of input.
772  /// \sa
773  /// - AkDurationCallbackInfo
774  /// - AK::SoundEngine::PostEvent()
775  /// - AK::SoundEngine::GetIDFromString()
776  virtual AkUniqueID GetAudioNodeID() = 0;
777 
778  /// Use this method to retrieve user data to this context. It is always initialized to NULL until you decide to set it otherwise.
779  /// \return Attached user data.
780  /// \sa SetUserData()
781  virtual void * GetUserData() = 0;
782 
783  /// Use this method to attach user data to this context. It is always initialized to NULL until you decide to set it otherwise.
784  /// \return Attached user data.
785  /// \sa GetUserData()
786  virtual void SetUserData( void * in_pUserData ) = 0;
787 
788  /// \name Default positioning information.
789  /// \warning The methods of this group are deprecated.
790  //@{
791 
792  /// Retrieve center percentage of this input.
793  /// \return Center percentage, between 0 and 1.
794  virtual AkReal32 GetCenterPerc() = 0;
795 
796  /// Retrieve the speaker panning type: type of panning logic when object is not 3D spatialized.
797  /// Note that the returned value is only relevant when the object is not 3D spatialized,
798  /// that is Get3DSpatializationMode returns AK_SpatializationMode_None.
799  /// \sa
800  /// - Get3DSpatializationMode()
802 
803  /// Speaker panning:
804  /// Retrieve the panner position (each vector component is between -1 and 1) of this input.
805  /// Note that the returned value is only relevant when the object is not 3D spatialized,
806  /// (Get3DSpatializationMode returns AK_SpatializationMode_None), and if speaker panning is not direct assignment
807  /// (GetSpeakerPanningType does not return AK_DirectSpeakerAssignment).
808  /// \sa
809  /// - GetSpeakerPanningType()
810  /// - Get3DSpatializationMode()
811  virtual void GetPannerPosition(
812  AkVector & out_position ///< Returned sound position.
813  ) = 0;
814 
815  /// Get the value of this input's Listener Relative Routing option, that is, if the emitter-listener relative
816  /// association is calculated at this node. Listener Relative Routing needs to be calculated in order for a node
817  /// to be spatialized or attenuated with respect to in-game emitter and listener positions. Otherwise it can only
818  /// be panned.
819  /// \sa
820  /// - Get3DSpatializationMode()
821  /// - Get3DPositionType()
822  /// - GetNum3DPositions()
823  virtual bool HasListenerRelativeRouting() = 0;
824 
825  /// Get whether the emitter position is defined by the game alone (AK_3DPositionType_Emitter), or if it is further automated
826  /// (AK_3DPositionType_EmitterWithAutomation, AK_3DPositionType_ListenerWithAutomation).
827  /// The resulting 3D position(s) may be obtained by Get3DPosition(), and used for 3D spatialization or attenuation.
828  /// \sa
829  /// - Get3DPosition()
830  /// - GetNum3DPositions()
831  /// - HasListenerRelativeRouting()
832  virtual Ak3DPositionType Get3DPositionType() = 0;
833 
834  /// 3D spatialization:
835  /// Retrieve the number of emitter-listener pairs (rays) of this input.
836  /// Note that the returned value is always 0 unless the input has listener relative routing (see HasListenerRelativeRouting()).
837  /// Use this function with Get3DPosition().
838  /// \sa
839  /// - Get3DPosition()
840  /// - HasListenerRelativeRouting()
841  virtual AkUInt32 GetNum3DPositions() = 0;
842 
843  /// 3D spatialization:
844  /// Retrieve the spherical coordinates of the desired emitter-listener pair (ray) corresponding to this
845  /// input, as automated by the engine. Applicable only when the input has listener relative routing (see HasListenerRelativeRouting()).
846  /// Returned rays are those that result from engine automation, if applicable.
847  /// \return AK_Success if the pair index is valid, AK_Fail otherwise.
848  /// \sa
849  /// - HasListenerRelativeRouting()
850  /// - GetNum3DPositions()
851  virtual AKRESULT Get3DPosition(
852  AkUInt32 in_uIndex, ///< Index of the pair, [0, GetNum3DPositions()[
853  AkEmitterListenerPair & out_soundPosition ///< Returned sound position, in spherical coordinates.
854  ) = 0;
855 
856  /// 3D spatialization:
857  /// Evaluate spread value at the distance of the desired emitter-listener pair for this input.
858  /// Applicable only when the input has listener relative routing (see HasListenerRelativeRouting()).
859  /// \return The spread value, between 0 and 100. 0 if the pair index is invalid.
860  /// \sa
861  /// - HasListenerRelativeRouting()
862  /// - GetNum3DPositions()
863  /// - Get3DPosition()
864  virtual AkReal32 GetSpread(
865  AkUInt32 in_uIndex ///< Index of the pair, [0, GetNum3DPositions()[
866  ) = 0;
867 
868  /// 3D spatialization:
869  /// Evaluate focus value at the distance of the desired emitter-listener pair for this input.
870  /// Applicable only when the input has listener relative routing (see HasListenerRelativeRouting()).
871  /// \return The focus value, between 0 and 100. 0 if the pair index is invalid.
872  /// \sa
873  /// - HasListenerRelativeRouting()
874  /// - GetNum3DPositions()
875  /// - Get3DPosition()
876  virtual AkReal32 GetFocus(
877  AkUInt32 in_uIndex ///< Index of the pair, [0, GetNum3DPositions()[
878  ) = 0;
879 
880  /// Get the max distance as defined in the attenuation editor.
881  /// Applicable only when the input has listener relative routing (see HasListenerRelativeRouting()).
882  /// \return True if this input has attenuation, false otherwise.
883  virtual bool GetMaxAttenuationDistance(
884  AkReal32 & out_fMaxAttenuationDistance ///< Returned max distance.
885  ) = 0;
886 
887  /// Get next volumes as computed by the sound engine for this input.
888  virtual void GetSpatializedVolumes(
889  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).
890  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).
891  ) = 0;
892 
893  /// Query the 3D spatialization mode used by this input.
894  /// Applicable only when the input has listener relative routing (see HasListenerRelativeRouting()).
895  /// \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.
896  /// \sa
897  /// - HasListenerRelativeRouting()
899 
900  //@}
901  };
902 
903  /// Interface to retrieve contextual information for a sink plugin.
904  /// \sa
905  /// - AK::IAkSinkPlugin
907  {
908  protected:
909  /// Virtual destructor on interface to avoid warnings.
911 
912  public:
913 
914  /// Query if the sink plugin is instantiated on the main output device (primary tree).
915  /// \return True if the sink plugin is instantiated on the main output device (primary tree), false otherwise.
916  /// \sa
917  /// - AK::IAkSinkPlugin::IsDataNeeded()
918  /// - AK::IAkSinkPlugin::Consume()
919  virtual bool IsPrimary() = 0;
920 
921  /// Sink plugins may need to call this function to notify the audio thread that it should wake up
922  /// in order to potentially process an audio frame. Note that the audio thread may wake up for other
923  /// reasons, for example following calls to AK::SoundEngine::RenderAudio().
924  /// Once the audio thread is awaken, it will ask the sink plugin how many audio frames need to be
925  /// processed and presented to the plugin. This is done through AK::IAkSinkPlugin::IsDataNeeded()
926  /// and AK::IAkSinkPlugin::Consume() respectively.
927  /// Note that only the sink plugin that is instantiated on the main output device (primary tree) may control
928  /// the audio thread synchronization.
929  /// \return AK_Success if the calling plugin is instantiated on the main output device (primary tree),
930  /// AK_Fail otherwise.
931  /// \sa
932  /// - AK::IAkSinkPluginContext::IsPrimary()
933  /// - AK::IAkSinkPlugin::IsDataNeeded()
934  /// - AK::IAkSinkPlugin::Consume()
935  virtual AKRESULT SignalAudioThread() = 0;
936 
937  /// Query engine's user-defined sink queue depth (AkPlatformInitSettings::uNumRefillsInVoice).
938  /// \return The engine's AkPlatformInitSettings::uNumRefillsInVoice value on platforms for which it exists, 0 otherwise.
939  virtual AkUInt16 GetNumRefillsInVoice() = 0;
940  };
941 
942  /// Software effect plug-in interface for sink (audio end point) plugins.
943  class IAkSinkPlugin : public IAkPlugin
944  {
945  protected:
946  /// Virtual destructor on interface to avoid warnings.
947  virtual ~IAkSinkPlugin(){}
948 
949  public:
950 
951  /// Initialization of the sink plugin.
952  ///
953  /// This method prepares the audio device plug-in for data processing, allocates memory, and sets up initial conditions.
954  /// 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.
955  /// The AK::IAkSinkPluginContext interface allows to retrieve information related to the context in which the audio device plug-in is operated.
956  /// 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.
957  /// 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.
958  /// 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.
959  /// Note that the channel configuration is suggestive and may even be specified as AkChannelConfig::IsValid() == false.The plugin is free to determine the true channel configuration(this is an io parameter).
960  ///
961  /// \return AK_Success if successful.
962  /// \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.
963  /// \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.
964  /// All other return codes will be treated as temporary failures conditions and the sink will be requested again later.
965 
966  virtual AKRESULT Init(
967  IAkPluginMemAlloc * in_pAllocator, ///< Interface to memory allocator to be used by the effect.
968  IAkSinkPluginContext * in_pSinkPluginContext, ///< Interface to sink plug-in's context.
969  IAkPluginParam * in_pParams, ///< Interface to plug-in parameters.
970  AkAudioFormat & io_rFormat ///< Audio data format of the input signal. Note that the channel configuration is suggestive and may even be specified as AkChannelConfig::IsValid() == false. The plugin is free to determine the true channel configuration.
971  ) = 0;
972 
973  /// Obtain the number of audio frames that should be processed by the sound engine and presented
974  /// to this plugin via AK::IAkSinkPlugin::Consume(). The size of a frame is determined by the sound engine and
975  /// obtainable via AK::IAkPluginContextBase::GetMaxBufferLength().
976  /// \return AK_Success if successful, AK_Fail if there was a critical error.
977  /// \sa
978  /// - AK::IAkSinkPlugin::Consume()
979  /// - AK::IAkSinkPluginContext::SignalAudioThread()
980  virtual AKRESULT IsDataNeeded(
981  AkUInt32 & out_uNumFramesNeeded ///< Returned number of audio frames needed.
982  ) = 0;
983 
984  /// Present an audio buffer to the sink. The audio buffer is in the native format of the sound engine
985  /// (typically float, deinterleaved), as specified by io_rFormat passed to Init(). It is up to the
986  /// plugin to transform it into a format that is compatible with its output.
987  /// Note that Consume() is not called if the output for this frame consists of silence. Plugins should
988  /// detect this in OnFrameEnd().
989  /// \sa
990  /// - AK::IAkSinkPlugin::IsDataNeeded()
991  /// - AK::IAkSinkPlugin::OnFrameEnd()
992  virtual void Consume(
993  AkAudioBuffer * in_pInputBuffer, ///< Input audio buffer data structure. Plugins should avoid processing data in-place.
994  AkRamp in_gain ///< Volume gain to apply to this input (prev corresponds to the beginning, next corresponds to the end of the buffer).
995  ) = 0;
996 
997  /// 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.
998  /// \sa
999  /// - AK::IAkSinkPlugin::Consume()
1000  virtual void OnFrameEnd() = 0;
1001 
1002  /// Ask the plug-in whether starvation occurred.
1003  /// \return True if starvation occurred, false otherwise.
1004  virtual bool IsStarved() = 0;
1005 
1006  /// Reset the "starvation" flag after IsStarved() returned true.
1007  virtual void ResetStarved() = 0;
1008  };
1009 
1010  /// Wwise sound engine source plug-in interface (see \ref soundengine_plugins_source).
1011  class IAkSourcePlugin : public IAkPlugin
1012  {
1013  protected:
1014  /// Virtual destructor on interface to avoid warnings.
1015  virtual ~IAkSourcePlugin(){}
1016 
1017  public:
1018  /// Source plug-in initialization. Gets the plug-in ready for data processing, allocates memory and sets up the initial conditions.
1019  /// \aknote Memory allocation should be done through the appropriate macros (see \ref fx_memory_alloc). \endaknote
1020  /// \sa
1021  /// - \ref iaksourceeffect_init
1022  virtual AKRESULT Init(
1023  IAkPluginMemAlloc * in_pAllocator, ///< Interface to the memory allocator to be used by the plug-in
1024  IAkSourcePluginContext * in_pSourcePluginContext, ///< Interface to the source plug-in's context
1025  IAkPluginParam * in_pParams, ///< Interface to the plug-in parameters
1026  AkAudioFormat & io_rFormat ///< Audio format of the output data to be produced by the plug-in (mono native by default)
1027  ) = 0;
1028 
1029  /// This method is called to determine the approximate duration of the source.
1030  /// \return The duration of the source, in milliseconds.
1031  /// \sa
1032  /// - \ref iaksourceeffect_getduration
1033  virtual AkReal32 GetDuration() const = 0;
1034 
1035  /// This method is called to determine the estimated envelope of the source.
1036  /// \return The estimated envelope of the data that will be generated in the next call to
1037  /// Execute(). The envelope value should be normalized to the highest peak of the entire
1038  /// duration of the source. Expected range is [0,1]. If envelope and peak value cannot be
1039  /// predicted, the source should return 1 (no envelope).
1040  /// \sa
1041  /// - \ref iaksourceeffect_getenvelope
1042  virtual AkReal32 GetEnvelope() const
1043  {
1044  return 1.f;
1045  }
1046 
1047  /// This method is called to tell the source to stop looping.
1048  /// This will typically be called when an action of type "break" will be triggered on the playing source.
1049  /// 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.
1050  ///
1051  /// \return
1052  /// - 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.
1053  /// - AK_Fail if the source cannot simply stop looping, in this situation, the break command will end up stopping this source.
1054  /// \sa
1055  /// - \ref iaksourceeffect_stoplooping
1056  virtual AKRESULT StopLooping(){ return AK_Success; }
1057 
1058  /// This method is called to tell the source to seek to an arbitrary sample.
1059  /// This will typically be called when the game calls AK::SoundEngine::SeekOnEvent() where the event plays
1060  /// a sound that wraps this source plug-in.
1061  /// If the plug-in does not handle seeks, it should return AK_Success. If it returns AK_Fail, it will
1062  /// be terminated by the sound engine.
1063  ///
1064  /// \return
1065  /// - AK_Success if the source handles or ignores seek command.
1066  /// - AK_Fail if the source considers that seeking requests should provoke termination, for example, if
1067  /// the desired position is greater than the prescribed source duration.
1068  /// \sa
1069  /// - AK::SoundEngine::SeekOnEvent()
1070  virtual AKRESULT Seek(
1071  AkUInt32 /* in_uPosition */ ///< Position to seek to, in samples, at the rate specified in AkAudioFormat (see AK::IAkSourcePlugin::Init()).
1072  ) { return AK_Success; }
1073 
1074  /// 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
1075  /// avoiding most of the CPU hit of plug-in execution.
1076  /// 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
1077  /// return AK_DataReady or AK_NoMoreData, depending if there would be audio output or not at that point.
1078  /// 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.
1079  /// Note that returning AK_NotImplemeted for a source plug-ins that support asynchronous processing will produce a 'resume' virtual voice behavior instead.
1081  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.
1082  ) { return AK_NotImplemented; }
1083 
1084  /// Software effect plug-in DSP execution.
1085  /// \aknote The effect can output as much as wanted up to MaxFrames(). All sample frames passed uValidFrames at input time are
1086  /// not initialized and it is the responsibility of the effect to do so. When modifying the number of valid frames within execution
1087  /// (e.g. to flush delay lines) the effect should notify the pipeline by updating uValidFrames accordingly.
1088  /// \aknote The effect will stop being called by the pipeline when AK_NoMoreData is returned in the the eState field of the AkAudioBuffer structure.
1089  virtual void Execute(
1090  AkAudioBuffer * io_pBuffer ///< In/Out audio buffer data structure (in-place processing)
1091  ) = 0;
1092  };
1093 
1094 
1095  /// This function can be useful to convert from normalized floating point audio samples to HW-pipeline format samples.
1096  #define AK_FLOAT_TO_SAMPLETYPE( __in__ ) (__in__)
1097  /// 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.
1098  #define AK_FLOAT_TO_SAMPLETYPE_NOCLIP( __in__ ) (__in__)
1099  /// This function can be useful to convert from HW-pipeline format samples to normalized floating point audio samples.
1100  #define AK_SAMPLETYPE_TO_FLOAT( __in__ ) (__in__)
1101 
1102  #define AK_DBTOLIN( __db__ ) (powf(10.f,(__db__) * 0.05f))
1103 }
1104 
1105 /// Registered plugin creation function prototype.
1107 /// Registered plugin parameter node creation function prototype.
1109 
1110 struct AkPlatformInitSettings;
1111 struct AkInitSettings;
1112 
1113 namespace AK
1114 {
1115  /// Global plugin context used for plugin registration/initialization. Games query this interface from the sound engine.
1117  {
1118  protected:
1119  /// Virtual destructor on interface to avoid warnings.
1121 
1122  public:
1123 
1124  /// Retrieve the streaming manager access interface.
1125  virtual IAkStreamMgr * GetStreamMgr() const = 0;
1126 
1127  /// Retrieve the maximum number of frames that Execute() will be called with for this effect.
1128  /// Can be used by the effect to make memory allocation at initialization based on this worst case scenario.
1129  /// \return Maximum number of frames.
1130  virtual AkUInt16 GetMaxBufferLength() const = 0;
1131 
1132  /// Query whether sound engine is in real-time or offline (faster than real-time) mode.
1133  /// \return true when sound engine is in offline mode, false otherwise.
1134  virtual bool IsRenderingOffline() const = 0;
1135 
1136  /// Retrieve the core sample rate of the engine. This sample rate applies to all effects except source plugins, which declare their own sample rate.
1137  /// \return Core sample rate.
1138  virtual AkUInt32 GetSampleRate() const = 0;
1139 
1140  /// Post a monitoring message or error string. This will be displayed in the Wwise capture
1141  /// log.
1142  /// \return AK_Success if successful, AK_Fail if there was a problem posting the message.
1143  /// In optimized mode, this function returns AK_NotCompatible.
1144  /// \remark This function is provided as a tracking tool only. It does nothing if it is
1145  /// called in the optimized/release configuration and return AK_NotCompatible.
1146  virtual AKRESULT PostMonitorMessage(
1147  const char* in_pszError, ///< Message or error string to be displayed
1148  AK::Monitor::ErrorLevel in_eErrorLevel ///< Specifies whether it should be displayed as a message or an error
1149  ) = 0;
1150 
1151  /// Register a plug-in with the sound engine and set the callback functions to create the
1152  /// plug-in and its parameter node.
1153  /// \sa
1154  /// - \ref register_effects
1155  /// - \ref plugin_xml
1156  /// \return AK_Success if successful, AK_InvalidParameter if invalid parameters were provided or Ak_Fail otherwise. Possible reasons for an AK_Fail result are:
1157  /// - Insufficient memory to register the plug-in
1158  /// - Plug-in ID already registered
1159  /// \remarks
1160  /// Codecs and plug-ins must be registered before loading banks that use them.\n
1161  /// Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
1162  /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
1163  /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
1164  /// posting the event will fail.
1165  virtual AKRESULT RegisterPlugin(
1166  AkPluginType in_eType, ///< Plug-in type (for example, source or effect)
1167  AkUInt32 in_ulCompanyID, ///< Company identifier (as declared in the plug-in description XML file)
1168  AkUInt32 in_ulPluginID, ///< Plug-in identifier (as declared in the plug-in description XML file)
1169  AkCreatePluginCallback in_pCreateFunc, ///< Pointer to the plug-in's creation function
1170  AkCreateParamCallback in_pCreateParamFunc ///< Pointer to the plug-in's parameter node creation function
1171  ) = 0;
1172 
1173  /// Register a codec type with the sound engine and set the callback functions to create the
1174  /// codec's file source and bank source nodes.
1175  /// \sa
1176  /// - \ref register_effects
1177  /// \return AK_Success if successful, AK_InvalidParameter if invalid parameters were provided, or Ak_Fail otherwise. Possible reasons for an AK_Fail result are:
1178  /// - Insufficient memory to register the codec
1179  /// - Codec ID already registered
1180  /// \remarks
1181  /// Codecs and plug-ins must be registered before loading banks that use them.\n
1182  /// Loading a bank referencing an unregistered plug-in or codec will result in a load bank success,
1183  /// but the plug-ins will not be used. More specifically, playing a sound that uses an unregistered effect plug-in
1184  /// will result in audio playback without applying the said effect. If an unregistered source plug-in is used by an event's audio objects,
1185  /// posting the event will fail.
1186  virtual AKRESULT RegisterCodec(
1187  AkUInt32 in_ulCompanyID, ///< Company identifier (as declared in XML)
1188  AkUInt32 in_ulPluginID, ///< Plugin identifier (as declared in XML)
1189  AkCreateFileSourceCallback in_pFileCreateFunc, ///< Factory for streaming sources.
1190  AkCreateBankSourceCallback in_pBankCreateFunc ///< Factory for in-memory sources.
1191  ) = 0;
1192 
1193  /// Register a global callback function. This function will be called from the audio rendering thread, at the
1194  /// location specified by in_eLocation. This function will also be called from the thread calling
1195  /// AK::SoundEngine::Term with in_eLocation set to AkGlobalCallbackLocation_Term.
1196  /// For example, in order to be called at every audio rendering pass, and once during teardown for releasing resources, you would call
1197  /// RegisterGlobalCallback(AkPluginTypeEffect, MY_COMPANY_ID , MY_PLUGIN_ID, myCallback, AkGlobalCallbackLocation_BeginRender | AkGlobalCallbackLocation_Term, myCookie);
1198  /// \remarks
1199  /// 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.
1200  /// 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).
1201  /// Timers will be registered to callbacks at all locations except for AkGlobalCallbackLocation_Register and AkGlobalCallbackLocation_Term.
1202  /// It is illegal to call this function while already inside of a global callback.
1203  /// This function might stall for several milliseconds before returning.
1204  /// \sa
1205  /// - AK::IAkGlobalPluginContext::UnregisterGlobalCallback()
1206  /// - AkGlobalCallbackFunc
1207  /// - AkGlobalCallbackLocation
1209  AkPluginType in_eType, ///< A valid Plug-in type (for example, source or effect).
1210  AkUInt32 in_ulCompanyID, ///< Company identifier (as declared in the plug-in description XML file).
1211  AkUInt32 in_ulPluginID, ///< Plug-in identifier (as declared in the plug-in description XML file).
1212  AkGlobalCallbackFunc in_pCallback, ///< Function to register as a global callback.
1213  AkUInt32 in_eLocation = AkGlobalCallbackLocation_BeginRender, ///< Callback location defined in AkGlobalCallbackLocation. Bitwise OR multiple locations if needed.
1214  void * in_pCookie = NULL ///< User cookie.
1215  ) = 0;
1216 
1217  /// Unregister a global callback function, previously registered using RegisterGlobalCallback.
1218  /// \remarks
1219  /// It is legal to call this function while already inside of a global callback, If it is unregistering itself and not
1220  /// another callback.
1221  /// This function might stall for several milliseconds before returning.
1222  /// \sa
1223  /// - AK::IAkGlobalPluginContext::RegisterGlobalCallback()
1224  /// - AkGlobalCallbackFunc
1225  /// - AkGlobalCallbackLocation
1227  AkGlobalCallbackFunc in_pCallback, ///< Function to unregister as a global callback.
1228  AkUInt32 in_eLocation = AkGlobalCallbackLocation_BeginRender ///< Must match in_eLocation as passed to RegisterGlobalCallback for this callback.
1229  ) = 0;
1230 
1231  /// Get the default allocator for plugins. This is useful for performing global initialization tasks shared across multiple plugin instances.
1232  virtual AK::IAkPluginMemAlloc * GetAllocator() = 0;
1233 
1234  /// \sa SetRTPCValue
1235  virtual AKRESULT SetRTPCValue(
1236  AkRtpcID in_rtpcID, ///< ID of the game parameter
1237  AkRtpcValue in_value, ///< Value to set
1238  AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT,///< Associated game object ID
1239  AkTimeMs in_uValueChangeDuration = 0, ///< Duration during which the game parameter is interpolated towards in_value
1240  AkCurveInterpolation in_eFadeCurve = AkCurveInterpolation_Linear, ///< Curve type to be used for the game parameter interpolation
1241  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.
1242  ) = 0;
1243 
1244  /// Send custom game data to a plugin that resides on a bus (insert effect or mixer plugin).
1245  /// Data will be copied and stored into a separate list.
1246  /// Previous entry is deleted when a new one is sent.
1247  /// Set the data pointer to NULL to clear item from the list.
1248  /// This means that you cannot send different data to various instances of the plugin on a same bus.\endaknote
1249  /// \return AK_Success if data was sent successfully.
1251  AkUniqueID in_busID, ///< Bus ID
1252  AkGameObjectID in_busObjectID, ///< Bus Object ID
1253  AkPluginType in_eType, ///< Plug-in type (for example, source or effect)
1254  AkUInt32 in_uCompanyID, ///< Company identifier (as declared in the plug-in description XML file)
1255  AkUInt32 in_uPluginID, ///< Plug-in identifier (as declared in the plug-in description XML file)
1256  const void* in_pData, ///< The data blob
1257  AkUInt32 in_uSizeInBytes ///< Size of data
1258  ) = 0;
1259 
1260  /// N to N channels mix
1261  virtual void MixNinNChannels(
1262  AkAudioBuffer * in_pInputBuffer, ///< Input multichannel buffer.
1263  AkAudioBuffer * in_pMixBuffer, ///< Multichannel buffer with which the input buffer is mixed.
1264  AkReal32 in_fPrevGain, ///< Gain, corresponding to the beginning of the buffer, to apply uniformly to each mixed channel.
1265  AkReal32 in_fNextGain, ///< Gain, corresponding to the end of the buffer, to apply uniformly to each mixed channel.
1266  AK::SpeakerVolumes::ConstMatrixPtr in_mxPrevVolumes,///< In/out channel volume distribution corresponding to the beginning of the buffer (see AK::SpeakerVolumes::Matrix services).
1267  AK::SpeakerVolumes::ConstMatrixPtr in_mxNextVolumes ///< In/out channel volume distribution corresponding to the end of the buffer (see AK::SpeakerVolumes::Matrix services).
1268  ) = 0;
1269 
1270  /// 1 to N channels mix
1271  virtual void Mix1inNChannels(
1272  AkReal32 * AK_RESTRICT in_pInChannel, ///< Input channel buffer.
1273  AkAudioBuffer * in_pMixBuffer, ///< Multichannel buffer with which the input buffer is mixed.
1274  AkReal32 in_fPrevGain, ///< Gain, corresponding to the beginning of the input channel.
1275  AkReal32 in_fNextGain, ///< Gain, corresponding to the end of the input channel.
1276  AK::SpeakerVolumes::ConstVectorPtr in_vPrevVolumes, ///< Output channel volume distribution corresponding to the beginning of the buffer (see AK::SpeakerVolumes::Vector services).
1277  AK::SpeakerVolumes::ConstVectorPtr in_vNextVolumes ///< Output channel volume distribution corresponding to the end of the buffer (see AK::SpeakerVolumes::Vector services).
1278  ) = 0;
1279 
1280  /// Single channel mix
1281  virtual void MixChannel(
1282  AkReal32 * AK_RESTRICT in_pInBuffer, ///< Input channel buffer.
1283  AkReal32 * AK_RESTRICT in_pOutBuffer, ///< Output channel buffer.
1284  AkReal32 in_fPrevGain, ///< Gain, corresponding to the beginning of the input channel.
1285  AkReal32 in_fNextGain, ///< Gain, corresponding to the end of the input channel.
1286  AkUInt16 in_uNumFrames ///< Number of frames to mix.
1287  ) = 0;
1288 
1289  /// Computes gain vector for encoding a source with angles in_fAzimuth and in_fElevation to full-sphere ambisonics with order in_uOrder.
1290  /// Ambisonic channels are ordered by ACN and use the SN3D convention.
1291  virtual void ComputeAmbisonicsEncoding(
1292  AkReal32 in_fAzimuth, ///< Incident angle, in radians [-pi,pi], where 0 is the front (positive values are clockwise).
1293  AkReal32 in_fElevation, ///< Incident angle, in radians [-pi/2,pi/2], where 0 is the azimuthal plane.
1294  AkChannelConfig in_cfgAmbisonics, ///< Determines number of gains in vector out_vVolumes.
1295  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. You may obtain the number of channels from the order using the helper AK::AmbisonicOrderToNumChannels().
1296  ) = 0;
1297 
1298  /// 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
1299  /// expressed in left-handed cartesian coordinates, with unitary norm.
1300  /// This decoding technique is optimal for regular sampling.
1301  /// The returned matrix has in_cfgAmbisonics.uNumChannels inputs (rows) and in_uNumSamples outputs (columns), and is normalized by the number of samples.
1302  /// Supported ambisonic configurations are full-sphere 1st, 2nd and 3rd order.
1303  /// \return AK_Fail when ambisonic configuration. AK_Success otherwise.
1305  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.
1306  AkUInt32 in_uNumSamples, ///< Number of points in in_samples.
1307  AkChannelConfig in_cfgAmbisonics, ///< Ambisonic configuration. Supported configurations are 1-1, 2-2 and 3-3. Determines number of rows (input channels) in matrix out_mxVolume.
1308  AK::SpeakerVolumes::MatrixPtr out_mxVolume ///< Returned volume matrix (see AK::SpeakerVolumes::Matrix services). Must be allocated prior to calling this function with the size returned by AK::SpeakerVolumes::Matrix::GetRequiredSize() for the desired number of channels. You may obtain the number of channels from the order using the helper AK::AmbisonicOrderToNumChannels().
1309  ) = 0;
1310 
1311  /// Return an acoustic texture.
1312  /// \return The pointer to an acoustic texture if successful, NULL otherwise.
1313  virtual const AkAcousticTexture* GetAcousticTexture(
1314  AkAcousticTextureID in_AcousticTextureID ///< Acoustic Texture's ID
1315  ) = 0;
1316 
1317  /// Given an emitter-listener pair, compute the azimuth and elevation angles of the emitter relative to the listener.
1318  /// \return AK_Success if the listener referenced in the emitter-listener pair was found; azimuth and elevation.
1320  const AkEmitterListenerPair & in_pair, ///< Emitter-listener pair for which to compute azimuth and elevation angles.
1321  AkReal32 & out_fAzimuth, ///< Returned azimuthal angle, in radians.
1322  AkReal32 & out_fElevation ///< Returned elevation angle, in radians.
1323  ) const = 0;
1324 
1325  /// Get the platform init settings that the wwise sound engine has been initialized with.
1326  /// This function returns a null pointer if called with an instance of RenderFXGlobalContext.
1327  virtual const AkPlatformInitSettings* GetPlatformInitSettings() const = 0;
1328 
1329  /// Get the init settings that the wwise sound engine has been initialized with
1330  /// This function returns a null pointer if called with an instance of RenderFXGlobalContext.
1331  virtual const AkInitSettings* GetInitSettings() const = 0;
1332 
1333  /// Gets the configured audio settings.
1334  /// Call this function to get the configured audio settings.
1335  ///
1336  /// \warning This function is not thread-safe.
1337  /// \warning Call this function only after the sound engine has been properly initialized.
1338  virtual AKRESULT GetAudioSettings(
1339  AkAudioSettings & out_audioSettings ///< Returned audio settings
1340  ) const = 0;
1341 
1342  /// Universal converter from string to ID for the sound engine.
1343  /// Calls AK::SoundEngine::GetIDFromString.
1344  /// \sa
1345  /// - <tt>AK::SoundEngine::GetIDFromString</tt>
1346  virtual AkUInt32 GetIDFromString(const char* in_pszString) const = 0;
1347 
1348  /// Synchronously posts an Event to the sound engine (by event ID).
1349  /// The callback function can be used to be noticed when markers are reached or when the event is finished.
1350  /// An array of wave file sources can be provided to resolve External Sources triggered by the event.
1351  /// \return The playing ID of the event launched, or AK_INVALID_PLAYING_ID if posting the event failed
1352  /// \remarks
1353  /// This function executes the actions contained in the event without going through the message queue.
1354  /// In order to do so it acquires the global Wwise sound engine lock. It should therefore only be called from one of the
1355  /// global engine hooks (see AK::IAkGlobalPluginContext::RegisterGlobalCallback).
1356  /// Use AK::IAkGlobalPluginContext::GetIDFromString() if you use event names (strings).
1357  /// \sa
1358  /// - <tt>AK::SoundEngine::PostEvent</tt>
1359  /// - <tt>AK::IAkGlobalPluginContext::RegisterGlobalCallback</tt>
1360  /// - <tt>AK::IAkGlobalPluginContext::GetIDFromString</tt>
1361  virtual AkPlayingID PostEventSync(
1362  AkUniqueID in_eventID, ///< Unique ID of the event
1363  AkGameObjectID in_gameObjectID, ///< Associated game object ID
1364  AkUInt32 in_uFlags = 0, ///< Bitmask: see \ref AkCallbackType
1365  AkCallbackFunc in_pfnCallback = NULL, ///< Callback function
1366  void * in_pCookie = NULL, ///< Callback cookie that will be sent to the callback function along with additional information
1367  AkUInt32 in_cExternals = 0, ///< Optional count of external source structures
1368  AkExternalSourceInfo *in_pExternalSources = NULL,///< Optional array of external source resolution information
1369  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.
1370  ) = 0;
1371 
1372  /// Executes a number of MIDI Events on all nodes that are referenced in the specified Event in an Action of type Play.
1373  /// Each MIDI event will be posted in AkMIDIPost::uOffset samples from the start of the current frame. The duration of
1374  /// a sample can be determined from the sound engine's audio settings, via a call to AK::IAkGlobalPluginContext::GetAudioSettings.
1375  /// \remarks
1376  /// This function executes the MIDI Events 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::PostMIDIOnEvent</tt>
1382  /// - <tt>AK::IAkGlobalPluginContext::GetAudioSettings</tt>
1383  /// - <tt>AK::IAkGlobalPluginContext::StopMIDIOnEventSync</tt>
1384  /// - <tt>AK::IAkGlobalPluginContext::RegisterGlobalCallback</tt>
1385  /// - <tt>AK::IAkGlobalPluginContext::GetIDFromString</tt>
1386  virtual AKRESULT PostMIDIOnEventSync(
1387  AkUniqueID in_eventID, ///< Unique ID of the Event
1388  AkGameObjectID in_gameObjectID, ///< Associated game object ID
1389  AkMIDIPost* in_pPosts, ///< MIDI Events to post
1390  AkUInt16 in_uNumPosts ///< Number of MIDI Events to post
1391  ) = 0;
1392 
1393  /// Stops MIDI notes on all nodes that are referenced in the specified event in an action of type play,
1394  /// with the specified Game Object. Invalid parameters are interpreted as wildcards. For example, calling
1395  /// this function with in_eventID set to AK_INVALID_UNIQUE_ID will stop all MIDI notes for Game Object
1396  /// in_gameObjectID.
1397  /// \remarks
1398  /// This function stops the MIDI notes without going through the message queue.
1399  /// In order to do so it acquires the global Wwise sound engine lock. It should therefore only be called from one of the
1400  /// global engine hooks (see AK::IAkGlobalPluginContext::RegisterGlobalCallback).
1401  /// Use AK::IAkGlobalPluginContext::GetIDFromString() if you use event names (strings).
1402  /// \sa
1403  /// - <tt>AK::IAkGlobalPluginContext::PostMIDIOnEvent</tt>
1404  /// - <tt>AK::IAkGlobalPluginContext::GetIDFromString</tt>
1405  virtual AKRESULT StopMIDIOnEventSync(
1406  AkUniqueID in_eventID = AK_INVALID_UNIQUE_ID, ///< Unique ID of the Event
1407  AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT ///< Associated game object ID
1408  ) = 0;
1409  };
1410 
1411  /// 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.
1412  /// \sa \ref soundengine_plugins
1414  {
1415  public:
1417  AkPluginType in_eType, ///< Plugin type.
1418  AkUInt32 in_ulCompanyID, ///< Plugin company ID.
1419  AkUInt32 in_ulPluginID, ///< Plugin ID.
1420  AkCreatePluginCallback in_pCreateFunc, ///< Plugin object factory.
1421  AkCreateParamCallback in_pCreateParamFunc, ///< Plugin parameter object factory.
1422  AkGlobalCallbackFunc in_pRegisterCallback = NULL, ///< Optional callback function called after successful plugin registration, with argument AkGlobalCallbackLocation_Register.
1423  void * in_pRegisterCallbackCookie = NULL ///< Optional cookie passed to register callback function above.
1424  )
1426  , m_eType(in_eType)
1427  , m_ulCompanyID(in_ulCompanyID)
1428  , m_ulPluginID(in_ulPluginID)
1429  , m_pCreateFunc(in_pCreateFunc)
1430  , m_pCreateParamFunc(in_pCreateParamFunc)
1433  , m_pRegisterCallback(in_pRegisterCallback)
1434  , m_pRegisterCallbackCookie(in_pRegisterCallbackCookie)
1435  {
1436  g_pAKPluginList = this;
1437  }
1438 
1440  AkUInt32 in_ulCompanyID, ///< Plugin company ID.
1441  AkUInt32 in_ulPluginID, ///< Plugin ID.
1442  AkCreateFileSourceCallback in_pCreateFile, ///< Streamed source factory.
1443  AkCreateBankSourceCallback in_pCreateBank) ///< In-memory source factory.
1446  , m_ulCompanyID(in_ulCompanyID)
1447  , m_ulPluginID(in_ulPluginID)
1448  , m_pCreateFunc(NULL)
1450  , m_pFileCreateFunc(in_pCreateFile)
1451  , m_pBankCreateFunc(in_pCreateBank)
1454  {
1455  g_pAKPluginList = this;
1456  }
1457 
1468  };
1469 }
1470 
1471 #define AK_IMPLEMENT_PLUGIN_FACTORY(_pluginName_, _plugintype_, _companyid_, _pluginid_) \
1472  AK::IAkPlugin* Create##_pluginName_(AK::IAkPluginMemAlloc * in_pAllocator); \
1473  AK::IAkPluginParam * Create##_pluginName_##Params(AK::IAkPluginMemAlloc * in_pAllocator); \
1474  AK::PluginRegistration _pluginName_##Registration(_plugintype_, _companyid_, _pluginid_, Create##_pluginName_, Create##_pluginName_##Params);
1475 
1476 #define AK_STATIC_LINK_PLUGIN(_pluginName_) \
1477  extern AK::PluginRegistration _pluginName_##Registration; \
1478  void *_pluginName_##_linkonceonly = (void*)&_pluginName_##Registration;
1479 
1480 #define DEFINE_PLUGIN_REGISTER_HOOK AK_DLLEXPORT AK::PluginRegistration * g_pAKPluginList = NULL;
1481 
1482 #define AK_GET_SINK_TYPE_FROM_DEVICE_KEY(_key) ((AkUInt32)(_key & 0xffffffff))
1483 #define AK_GET_DEVICE_ID_FROM_DEVICE_KEY(_key) ((AkUInt32)(_key >> 32))
1484 
1485 #endif // _IAK_PLUGIN_H_
Start of frame rendering, after having processed game messages.
Definition: AkCallback.h:305
AkConnectionType
Nature of the connection binding an input to a bus.
Definition: AkTypes.h:302
AK::IAkPluginParam *(* AkCreateParamCallback)(AK::IAkPluginMemAlloc *in_pAllocator)
Registered plugin parameter node creation function prototype.
Definition: IAkPlugin.h:1108
bool bIsInPlace
Buffer usage (in-place or not)
Definition: IAkPlugin.h:70
virtual AkSpeakerPanningType GetSpeakerPanningType()=0
PluginRegistration(AkUInt32 in_ulCompanyID, AkUInt32 in_ulPluginID, AkCreateFileSourceCallback in_pCreateFile, AkCreateBankSourceCallback in_pCreateBank)
Definition: IAkPlugin.h:1439
const AkReal32 * ConstMatrixPtr
Constant volume matrix. Access each input channel vector with AK::SpeakerVolumes::Matrix::GetChannel(...
Definition: AkSpeakerVolumes.h:52
virtual AKRESULT TimeSkip(AkUInt32 &io_uFrames)=0
virtual AKRESULT ComputeSphericalCoordinates(const AkEmitterListenerPair &in_pair, AkReal32 &out_fAzimuth, AkReal32 &out_fElevation) const =0
Compressor/decompressor plug-in (allows support for custom audio file types).
Definition: AkTypes.h:829
AkUInt32 uBuildVersion
Plugin build version, must match the AK_WWISESDK_VERSION_COMBINED macro from AkWwiseSDKVersion....
Definition: IAkPlugin.h:69
Software effect plug-in interface for sink (audio end point) plugins.
Definition: IAkPlugin.h:943
virtual AkUInt16 GetNumRefillsInVoice()=0
AkCurveInterpolation
Curve interpolation types.
Definition: AkTypes.h:571
#define AK_CALLBACK(__TYPE__, __NAME__)
AkInt16 AkPluginParamID
Source or effect plug-in parameter ID.
Definition: AkTypes.h:76
virtual ~IAkVoicePluginInfo()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:197
virtual AkUInt32 GetNumGameObjectPositions() const =0
uint16_t AkUInt16
Unsigned 16-bit integer.
Definition: AkTypes.h:78
virtual AKRESULT UnregisterGlobalCallback(AkGlobalCallbackFunc in_pCallback, AkUInt32 in_eLocation=AkGlobalCallbackLocation_BeginRender)=0
virtual void GetPluginMedia(AkUInt32 in_dataIndex, AkUInt8 *&out_rpData, AkUInt32 &out_rDataSize)=0
AkPluginType
Definition: AkTypes.h:826
virtual AkReal32 GetCenterPerc()=0
The operation was successful.
Definition: AkTypes.h:129
virtual AkReal32 GetDownstreamGain()=0
virtual IAkVoicePluginInfo * GetVoiceInfo()=0
virtual AKRESULT SetRTPCValue(AkRtpcID in_rtpcID, AkRtpcValue in_value, AkGameObjectID in_gameObjectID=AK_INVALID_GAME_OBJECT, AkTimeMs in_uValueChangeDuration=0, AkCurveInterpolation in_eFadeCurve=AkCurveInterpolation_Linear, bool in_bBypassInternalValueInterpolation=false)=0
Defines the parameters of an audio buffer format.
Definition: AkCommonDefs.h:59
AkGlobalCallbackFunc m_pRegisterCallback
Definition: IAkPlugin.h:1466
virtual AkPlayingID PostEventSync(AkUniqueID in_eventID, AkGameObjectID in_gameObjectID, AkUInt32 in_uFlags=0, AkCallbackFunc in_pfnCallback=NULL, void *in_pCookie=NULL, AkUInt32 in_cExternals=0, AkExternalSourceInfo *in_pExternalSources=NULL, AkPlayingID in_PlayingID=AK_INVALID_PLAYING_ID)=0
virtual AkUniqueID GetBusID()=0
virtual AKRESULT PostMonitorMessage(const char *in_pszError, AK::Monitor::ErrorLevel in_eErrorLevel)=0
virtual ~IAkEffectPluginContext()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:325
virtual AKRESULT PostMonitorMessage(const char *in_pszError, AK::Monitor::ErrorLevel in_eErrorLevel)=0
virtual AkReal32 GetEnvelope() const
Definition: IAkPlugin.h:1042
virtual AkUInt32 GetNumEmitterListenerPairs() const =0
virtual const AkInitSettings * GetInitSettings() const =0
virtual AKRESULT PostMIDIOnEventSync(AkUniqueID in_eventID, AkGameObjectID in_gameObjectID, AkMIDIPost *in_pPosts, AkUInt16 in_uNumPosts)=0
virtual AKRESULT RegisterPlugin(AkPluginType in_eType, AkUInt32 in_ulCompanyID, AkUInt32 in_ulPluginID, AkCreatePluginCallback in_pCreateFunc, AkCreateParamCallback in_pCreateParamFunc)=0
virtual IAkVoicePluginInfo * GetVoiceInfo()=0
virtual AKRESULT TimeSkip(AkUInt32 &)
Definition: IAkPlugin.h:1080
AKRESULT
Standard function call result.
Definition: AkTypes.h:126
void(* AkGlobalCallbackFunc)(AK::IAkGlobalPluginContext *in_pContext, AkGlobalCallbackLocation in_eLocation, void *in_pCookie)
Definition: AkCallback.h:326
uint8_t AkUInt8
Unsigned 8-bit integer.
Definition: AkTypes.h:77
virtual void * GetUserData()=0
AkUInt32 AkRtpcID
Real time parameter control ID.
Definition: AkTypes.h:83
AkPluginType eType
Plug-in type.
Definition: IAkPlugin.h:68
virtual void * GetCookie() const =0
virtual AKRESULT Compute3DPositioning(AkReal32 in_fAngle, AkReal32 in_fElevation, AkReal32 in_fSpread, AkReal32 in_fFocus, AkChannelConfig in_inputConfig, AkChannelMask in_uInputChanSel, AkChannelConfig in_outputConfig, AkReal32 in_fCenterPerc, AK::SpeakerVolumes::MatrixPtr out_mxVolumes)=0
virtual IAkPluginParam * Clone(IAkPluginMemAlloc *in_pAllocator)=0
virtual AKRESULT Init(IAkPluginMemAlloc *in_pAllocator, IAkSinkPluginContext *in_pSinkPluginContext, IAkPluginParam *in_pParams, AkAudioFormat &io_rFormat)=0
virtual AKRESULT SetParam(AkPluginParamID in_paramID, const void *in_pValue, AkUInt32 in_uParamSize)=0
#define AK_DLLEXPORT
virtual AkMIDIEvent GetMidiEvent() const =0
Audiokinetic namespace.
virtual void ComputeAmbisonicsEncoding(AkReal32 in_fAzimuth, AkReal32 in_fElevation, AkChannelConfig in_cfgAmbisonics, AK::SpeakerVolumes::VectorPtr out_vVolumes)=0
virtual IAkVoicePluginInfo * GetVoiceInfo()=0
virtual ~IAkPluginParam()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:543
virtual IAkGlobalPluginContext * GlobalContext() const =0
AK_DLLEXPORT AK::PluginRegistration * g_pAKPluginList
Definition: IAkPlugin.h:80
virtual AKRESULT TermSphericalVBAP(AK::IAkPluginMemAlloc *in_pAllocator, void *in_pPannerData)=0
ErrorLevel
ErrorLevel.
Definition: AkMonitorError.h:41
virtual AKRESULT RegisterCodec(AkUInt32 in_ulCompanyID, AkUInt32 in_ulPluginID, AkCreateFileSourceCallback in_pFileCreateFunc, AkCreateBankSourceCallback in_pBankCreateFunc)=0
virtual bool IsSendModeEffect() const =0
Global plugin context used for plugin registration/initialization. Games query this interface from th...
Definition: IAkPlugin.h:1116
virtual void GetPannerPosition(AkVector &out_position)=0
virtual Ak3DSpatializationMode Get3DSpatializationMode()=0
AkUInt32 m_ulPluginID
Definition: IAkPlugin.h:1461
AkUInt32 AkChannelMask
Channel mask (similar to WAVE_FORMAT_EXTENSIBLE). Bit values are defined in AkSpeakerConfig....
Definition: AkTypes.h:90
virtual AKRESULT Init(IAkPluginMemAlloc *in_pAllocator, IAkSourcePluginContext *in_pSourcePluginContext, IAkPluginParam *in_pParams, AkAudioFormat &io_rFormat)=0
virtual AKRESULT Init(IAkPluginMemAlloc *in_pAllocator, const void *in_pParamsBlock, AkUInt32 in_uBlockSize)=0
virtual AKRESULT Reset()=0
Listener information.
Definition: AkTypes.h:557
virtual AKRESULT GetSpeakerAngles(AkReal32 *io_pfSpeakerAngles, AkUInt32 &io_uNumAngles, AkReal32 &out_fHeightAngle)=0
virtual ~IAkMixerPluginContext()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:396
virtual ~IAkPluginContextBase()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:220
AkPluginType m_eType
Definition: IAkPlugin.h:1459
Configured audio settings.
Definition: AkTypes.h:231
virtual void ResetStarved()=0
Reset the "starvation" flag after IsStarved() returned true.
#define AK_RESTRICT
Refers to the __restrict compilation flag available on some platforms.
Definition: AkTypes.h:59
virtual AKRESULT StopLooping()
Definition: IAkPlugin.h:1056
MultiPositionType
Definition: AkTypes.h:759
virtual ~IAkGlobalPluginContext()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:1120
AkUInt32 AkAcousticTextureID
Acoustic Texture ID.
Definition: AkTypes.h:92
virtual AKRESULT GetEmitterListenerPair(AkUInt32 in_uIndex, AkEmitterListenerPair &out_emitterListenerPair) const =0
virtual AKRESULT RelocateMedia(AkUInt8 *, AkUInt8 *)
Definition: IAkPlugin.h:666
AkReal32 AkRtpcValue
Real time parameter control value.
Definition: AkTypes.h:84
Volume ramp specified by end points "previous" and "next".
Definition: AkTypes.h:602
AkMeteringFlags
Metering flags. Used for specifying bus metering, through AK::SoundEngine::RegisterBusVolumeCallback(...
Definition: AkTypes.h:812
virtual AKRESULT Init(IAkPluginMemAlloc *in_pAllocator, IAkEffectPluginContext *in_pEffectPluginContext, IAkPluginParam *in_pParams, AkAudioFormat &io_rFormat)=0
AkUInt32 AkUniqueID
Unique 32-bit ID.
Definition: AkTypes.h:62
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 AKRESULT Term(IAkPluginMemAlloc *in_pAllocator)=0
virtual AKRESULT StopMIDIOnEventSync(AkUniqueID in_eventID=AK_INVALID_UNIQUE_ID, AkGameObjectID in_gameObjectID=AK_INVALID_GAME_OBJECT)=0
virtual AkUInt32 GetBusType()=0
IAkSoftwareCodec *(* AkCreateFileSourceCallback)(void *in_pCtx)
Registered file source creation function prototype.
Definition: AkTypes.h:741
AkCreateFileSourceCallback m_pFileCreateFunc
Definition: IAkPlugin.h:1464
virtual ~IAkSourcePlugin()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:1015
virtual ~IAkPlugin()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:614
Emitter-listener pair: Positioning data pertaining to a single pair of emitter and listener.
Definition: AkTypes.h:487
virtual AkReal32 GetDuration() const =0
AkInt8 AkPriority
Priority.
Definition: AkTypes.h:77
virtual AkUInt32 GetIDFromString(const char *in_pszString) const =0
virtual AKRESULT GetParentChannelConfig(AkChannelConfig &out_channelConfig) const =0
virtual AKRESULT ComputeWeightedAmbisonicsDecodingFromSampledSphere(const AkVector in_samples[], AkUInt32 in_uNumSamples, AkChannelConfig in_cfgAmbisonics, AK::SpeakerVolumes::MatrixPtr out_mxVolume)=0
virtual void Execute(AkAudioBuffer *io_pBuffer)=0
AkUInt64 AkGameObjectID
Game object ID.
Definition: AkTypes.h:70
virtual AKRESULT PostMonitorData(void *in_pData, AkUInt32 in_uDataSize)=0
AkReal32 * MatrixPtr
Volume matrix. Access each input channel vector with AK::SpeakerVolumes::Matrix::GetChannel().
Definition: AkSpeakerVolumes.h:50
virtual ~IAkSinkPlugin()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:947
Interface to retrieve information about an input of a mixer.
Definition: IAkPlugin.h:745
virtual AKRESULT SignalAudioThread()=0
const AkReal32 * ConstVectorPtr
Constant volume vector. Access each element with the standard bracket [] operator.
Definition: AkSpeakerVolumes.h:51
Wwise sound engine source plug-in interface (see How to Create Wwise Sound Engine Source Plug-ins).
Definition: IAkPlugin.h:1011
Interface to retrieve contextual information for a mixer.
Definition: IAkPlugin.h:392
virtual AkUInt32 GetNum3DPositions()=0
This feature is not implemented.
Definition: AkTypes.h:128
AkUInt32 m_ulCompanyID
Definition: IAkPlugin.h:1460
virtual AkUniqueID GetNodeID() const =0
virtual AkGameObjectID GetGameObjectID() const =0
Get the ID of the game object.
virtual IAkGameObjectPluginInfo * GetGameObjectInfo()=0
Definition: AkMidiTypes.h:228
virtual SoundEngine::MultiPositionType GetGameObjectMultiPositionType() const =0
virtual AkPlayingID GetPlayingID() const =0
Retrieve the Playing ID of the event corresponding to this voice (if applicable).
Linear (Default)
Definition: AkTypes.h:579
virtual AkConnectionType GetConnectionType()=0
IAkSoftwareCodec *(* AkCreateBankSourceCallback)(void *in_pCtx)
Registered bank source node creation function prototype.
Definition: AkTypes.h:743
virtual ~IAkGameObjectPluginInfo()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:94
virtual bool GetListeners(AkGameObjectID *out_aListenerIDs, AkUInt32 &io_uSize) const =0
virtual AkPriority ComputePriorityWithDistance(AkReal32 in_fDistance) const =0
virtual ~IAkEffectPlugin()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:681
virtual const AkAcousticTexture * GetAcousticTexture(AkAcousticTextureID in_AcousticTextureID)=0
virtual AkUniqueID GetAudioNodeID()=0
Unknown/invalid plug-in type.
Definition: AkTypes.h:828
Software effect plug-in interface (see How to Create Wwise Sound Engine Effect Plug-ins).
Definition: IAkPlugin.h:677
#define NULL
Definition: AkTypes.h:49
virtual void GetSpatializedVolumes(AK::SpeakerVolumes::MatrixPtr out_mxPrevVolumes, AK::SpeakerVolumes::MatrixPtr out_mxNextVolumes)=0
Get next volumes as computed by the sound engine for this input.
virtual AKRESULT TimeSkip(AkUInt32 in_uFrames)=0
AkCreateParamCallback m_pCreateParamFunc
Definition: IAkPlugin.h:1463
virtual void Execute(AkAudioBuffer *io_pBuffer)=0
static const AkPlayingID AK_INVALID_PLAYING_ID
Invalid playing ID.
Definition: AkTypes.h:101
virtual bool IsPrimary()=0
virtual AkPriority GetPriority() const =0
Ak3DPositionType
3D position type: defines what acts as the emitter position for computing spatialization against the ...
Definition: AkTypes.h:778
AkUInt32 AkPlayingID
Playing ID.
Definition: AkTypes.h:65
virtual AKRESULT GetListenerData(AkGameObjectID in_uListener, AkListener &out_listener) const =0
virtual bool IsRenderingOffline() const =0
AkUInt32 AkPluginID
Source or effect plug-in ID.
Definition: AkTypes.h:73
AkReal32 * VectorPtr
Volume vector. Access each element with the standard bracket [] operator.
Definition: AkSpeakerVolumes.h:49
virtual IAkStreamMgr * GetStreamMgr() const =0
Retrieve the streaming manager access interface.
virtual AK::IAkPluginMemAlloc * GetAllocator()=0
Get the default allocator for plugins. This is useful for performing global initialization tasks shar...
virtual Ak3DPositionType Get3DPositionType()=0
Position and orientation of game objects.
Definition: AkTypes.h:334
virtual AKRESULT Get3DPosition(AkUInt32 in_uIndex, AkEmitterListenerPair &out_soundPosition)=0
bool bCanChangeRate
True for effects whose sample throughput is different between input and output. Effects that can chan...
Definition: IAkPlugin.h:71
Spherical coordinates.
Definition: AkTypes.h:481
static const AkGameObjectID AK_INVALID_GAME_OBJECT
Invalid game object (may also mean all game objects)
Definition: AkTypes.h:98
virtual AKRESULT ComputeSpeakerVolumesPanner(const AkVector &in_position, AkReal32 in_fCenterPct, AkChannelConfig in_inputConfig, AkChannelConfig in_outputConfig, AK::SpeakerVolumes::MatrixPtr out_mxVolumes)=0
Compute a volume matrix given the position of the panner (Wwise 2D panner).
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.
3D vector.
Definition: AkTypes.h:310
virtual void SetUserData(void *in_pUserData)=0
virtual bool GetMaxAttenuationDistance(AkReal32 &out_fMaxAttenuationDistance)=0
virtual void OnFrameEnd()=0
virtual const AkPlatformInitSettings * GetPlatformInitSettings() const =0
virtual AKRESULT ComputeSpeakerVolumesDirect(AkChannelConfig in_inputConfig, AkChannelConfig in_outputConfig, AkReal32 in_fCenterPerc, AK::SpeakerVolumes::MatrixPtr out_mxVolumes)=0
Compute a direct speaker assignment volume matrix with proper downmixing rules between two channel co...
virtual IAkPluginParam * GetInputParam()=0
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 IsDataNeeded(AkUInt32 &out_uNumFramesNeeded)=0
virtual AKRESULT ComputePlanarVBAPGains(AkReal32 in_fAngle, AkChannelConfig in_outputConfig, AkReal32 in_fCenterPerc, AK::SpeakerVolumes::VectorPtr out_vVolumes)=0
PluginRegistration * pNext
Definition: IAkPlugin.h:1458
virtual AKRESULT ComputeSphericalVBAPGains(void *in_pPannerData, AkReal32 in_fAzimuth, AkReal32 in_fElevation, AkUInt32 in_uNumChannels, AK::SpeakerVolumes::VectorPtr out_vVolumes)=0
virtual bool CanPostMonitorData()=0
void * m_pRegisterCallbackCookie
Definition: IAkPlugin.h:1467
AkCreatePluginCallback m_pCreateFunc
Definition: IAkPlugin.h:1462
uint32_t AkUInt32
Unsigned 32-bit integer.
Definition: AkTypes.h:79
virtual void Execute(AkAudioBuffer *in_pBuffer, AkUInt32 in_uInOffset, AkAudioBuffer *out_pBuffer)=0
static const AkUniqueID AK_INVALID_UNIQUE_ID
Invalid unique 32-bit ID.
Definition: AkTypes.h:99
AK::IAkPlugin *(* AkCreatePluginCallback)(AK::IAkPluginMemAlloc *in_pAllocator)
Registered plugin creation function prototype.
Definition: IAkPlugin.h:1106
virtual AKRESULT SetParamsBlock(const void *in_pParamsBlock, AkUInt32 in_uBlockSize)=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
virtual AkReal32 GetGameObjectScaling() const =0
virtual AkUInt16 GetNumLoops() const =0
static const AkPluginParamID ALL_PLUGIN_DATA_ID
Definition: IAkPlugin.h:604
void(* AkCallbackFunc)(AkCallbackType in_eType, AkCallbackInfo *in_pCallbackInfo)
Definition: AkCallback.h:234
AkPluginInfo()
Constructor for default values.
Definition: IAkPlugin.h:60
virtual AkUniqueID GetNodeID() const =0
virtual void GetPluginCustomGameData(void *&out_rpData, AkUInt32 &out_rDataSize)=0
virtual AKRESULT GetPluginInfo(AkPluginInfo &out_rPluginInfo)=0
Game object information available to plugins.
Definition: IAkPlugin.h:90
virtual AKRESULT Seek(AkUInt32)
Definition: IAkPlugin.h:1070
virtual AkUInt32 GetSampleRate() const =0
Interface to retrieve contextual information available to all types of plugins.
Definition: IAkPlugin.h:216
float AkReal32
32-bit floating point
Definition: AkTypes.h:97
AkSpeakerPanningType
Speaker panning type: type of panning logic when object is not 3D spatialized (i.e....
Definition: AkTypes.h:770
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.
AkCreateBankSourceCallback m_pBankCreateFunc
Definition: IAkPlugin.h:1465
Ak3DSpatializationMode
3D spatialization mode.
Definition: AkTypes.h:794
virtual AkReal32 GetFocus(AkUInt32 in_uIndex)=0
virtual void Consume(AkAudioBuffer *in_pInputBuffer, AkRamp in_gain)=0
virtual AKRESULT GetGameObjectPosition(AkUInt32 in_uIndex, AkSoundPosition &out_position) const =0
virtual void EnableMetering(AkMeteringFlags in_eFlags)=0
virtual ~IAkMixerInputContext()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:749
virtual AkReal32 GetSpread(AkUInt32 in_uIndex)=0
virtual ~IAkSourcePluginContext()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:357
virtual AKRESULT GetAudioSettings(AkAudioSettings &out_audioSettings) const =0
virtual AKRESULT GetOutputID(AkUInt32 &out_uOutputID, AkPluginID &out_uDevicePlugin) const =0
virtual ~IAkSinkPluginContext()
Virtual destructor on interface to avoid warnings.
Definition: IAkPlugin.h:910
virtual AKRESULT Term(IAkPluginMemAlloc *in_pAllocator)=0
virtual bool SupportMediaRelocation() const
Definition: IAkPlugin.h:649
Software effect plug-in interface for in-place processing (see How to Create Wwise Sound Engine Effec...
Definition: IAkPlugin.h:697
virtual bool HasListenerRelativeRouting()=0
AkInt32 AkTimeMs
Time in ms.
Definition: AkTypes.h:66
virtual bool IsStarved()=0
bool bReserved
Legacy bIsAsynchronous plug-in flag, now unused. Preserved for plug-in backward compatibility....
Definition: IAkPlugin.h:72
virtual AKRESULT InitSphericalVBAP(AK::IAkPluginMemAlloc *in_pAllocator, const AkSphericalCoord *in_SphericalPositions, const AkUInt32 in_NbPoints, void *&out_pPannerData)=0
Software effect plug-in interface for out-of-place processing (see How to Create Wwise Sound Engine E...
Definition: IAkPlugin.h:721
virtual AkUInt16 GetMaxBufferLength() const =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:1416

Cette page a-t-elle été utile ?

Besoin d'aide ?

Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !

Visitez notre page d'Aide

Décrivez-nous de votre projet. Nous sommes là pour vous aider.

Enregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !

Partir du bon pied avec Wwise