버전
menu

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

이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요