目录

Wwise SDK 2018.1.11
AkSpatialAudio.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 Version: <VERSION> Build: <BUILDNUMBER>
25 Copyright (c) <COPYRIGHTYEAR> Audiokinetic Inc.
26 *******************************************************************************/
27 
28 /// \file
29 /// Spatial Audio interface.
30 
31 #pragma once
32 
35 
36 /// AkDiffractionFlags determine if diffraction values for sound passing through portals will be calculated, and how to apply those calculations to Wwise parameters.
38 {
39  DiffractionFlags_UseBuiltInParam = 1 << 0, ///< Set the Wwise built-in game parameter value for diffraction angle. This is a flexible approach that can be mapped to any Wwise parameter. Can also be used simply to monitor diffraction using the game object profiler in Wwise.
40  DiffractionFlags_UseObstruction = 1 << 1, ///< Use Wwise obstruction for dry-path diffraction. Dry-path diffraction is related to the angle off of a straight line of sight to a sound emitter.
41  DiffractionFlags_CalcEmitterVirtualPosition = 1 << 3, ///< An emitter that is not in the same room as the listener will have its apparent or virtual position calculated by Wwise spatial audio and passed on to the sound engine.
42 
44 };
45 
46 /// Initialization settings of the spatial audio module.
48 {
50  , uPoolSize(4 * 1024 * 1024)
55  {}
56 
57  AkMemPoolId uPoolID; ///< User-provided pool ID (see AK::MemoryMgr::CreatePool).
58  AkUInt32 uPoolSize; ///< Desired memory pool size if a new pool should be created. A pool will be created if uPoolID is not set (AK_INVALID_POOL_ID).
59  AkUInt32 uMaxSoundPropagationDepth; ///< Maximum number of portals that sound can propagate through; must be less than or equal to AK_MAX_SOUND_PROPAGATION_DEPTH.
60  AkUInt32 uDiffractionFlags; ///< Enable or disable specific diffraction features. See AkDiffractionFlags.
61  AkReal32 fDiffractionShadowAttenFactor; ///< Multiplier that is applied to the distance attenuation of diffracted sounds (sounds that are in the 'shadow region') to simulate the phenomenon where by diffracted sound waves decay faster than incident sound waves.
62  AkReal32 fDiffractionShadowDegrees; ///< Interpolation angle, in degrees, over which the fDiffractionShadowAttenFactor is applied.
63  ///< At a diffraction of 0, a multiplier of 1 (ie. none) is applied, and at an angle of fDiffractionShadowDegrees or greater, fDiffractionShadowAttenFactor is applied.
64  ///< A linear interpolation between 1 and fDiffractionShadowAttenFactor is applied when the angle is between 0 and fDiffractionShadowDegrees.
65 };
66 
67 // Settings for individual image sources.
69 {
71 
72  AkImageSourceSettings(AkVector in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
73  : params(in_sourcePosition, in_fDistanceScalingFactor, in_fLevel)
74  , texture()
75  , name()
76  {
77  }
78 
80  {
81  name.Term();
82  }
83 
84  /// Operator =
86  {
87  params = src.params;
88  texture = src.texture;
89  name = src.name;
90  name.AllocCopy();
91  return *this;
92  }
93 
94  void SetOneTexture(AkUniqueID in_texture)
95  {
96  texture.uNumTexture = 1;
97  texture.arTextureID[0] = in_texture;
98  }
99 
100  void SetName(const char* in_pName)
101  {
102  name = in_pName;
103  name.AllocCopy();
104  }
105 
106  /// Image source parameters.
108 
109  /// Acoustic texture that goes with this image source.
111 
112  /// Name given to image source, can be used to identify the image source in the AK Reflect plugin UI.
114 };
115 
116 /// Settings for a sound emitter.
118 {
119  /// Constructor
122  , reflectionsAuxBusGain(1.0f)
123  , reflectionsOrder(1)
124  , reflectorFilterMask(0xFFFFFFFF)
125  , roomReverbAuxBusGain(1.0f)
129  {
130  useImageSources = true;
131  }
132 
133  /// Name given to this sound emitter.
135 
136  /// Aux bus with the AkReflect plug-in that is used by the geometric reflections API. Set to AK_INVALID_UNIQUE_ID to disable geometric reflections.
137  /// \aknote For proper operation with AkReflect and the SpatialAudio API, any aux bus using AkReflect should have 'Listener Relative Routing' checked and the 3D Spatialization set to None in the Wwise authoring tool. See \ref spatial_audio_wwiseprojectsetup_businstances for more details. \endaknote
139 
140  /// A heuristic to stop the computation of reflections. Should be no longer (and possibly shorter for less CPU usage) than the maximum attenuation of
141  /// the sound emitter.
143 
144  /// Send gain (0.f-1.f) that is applied when sending to the bus that has the AkReflect plug-in. (reflectAuxBusID)
146 
147  /// Maximum number of reflections that will be processed when computing indirect paths via the geometric reflections API. Reflection processing grows
148  /// exponentially with the order of reflections, so this number should be kept low. Valid range: 1-4.
150 
151  /// Bit field that allows for filtering of reflector surfaces (triangles) for this sound emitter. Setting/or clearing bits that correspond to the same bits set in
152  /// the \c reflectorChannelMask of each \c AkTriangle can be used to filter out specific geometry for specific emitters. An example usage is to disable reflections
153  /// off the floor for sounds positioned at the camera. When processing the reflections, this bit mask is ANDed with each potential triangle's reflectorChannelMask to determine if the reflector/emitter pair can produce a valid hit.
155 
156  /// Send gain (0.f-1.f) that is applied when sending to the bus that is associated with the room that the emitter is in (assigned via ReverbAuxBus field of AkRoomParams).
157  /// This value is multiplied with the room-specific gain (ReverbLevel of AkRoomParams). Note that this value is not applied to aux sends that are set via SetEmitterAuxSendValues(),
158  /// and therefore may be used to scale and/or disable room reverb, either temporarily or permanently, for a specific emitter.
159  /// \sa
160  /// - \ref AkRoomParams
161  /// - \ref AK::SpatialAudio::SetEmitterAuxSendValues
163 
164  /// The maximum number of edges that the sound can diffract around between the emitter and the listener. Applies only to geometric diffraction, and not to sound propagation.
165  /// Setting \c diffractionMaxEdges to 0 effectively disables geometric diffraction for this sound emitter.
167 
168  /// The maximum number of paths to the listener that the sound can take around obstacles. Applies only to geometric diffraction, and not sound propagation.
169  /// Diffraction paths map directly to virtual sound positions. Setting \c diffractionMaxPaths limits the number sound positions that are rendered for the game object.
170  /// Setting \c diffractionMaxPaths to 0 effectively disables geometric diffraction for this sound emitter.
172 
173  /// The maximum length that a diffracted sound can travel. Should be no longer (and possibly shorter for less CPU usage) than the maximum attenuation of
174  /// the sound emitter. Applies only to geometric diffraction, and not to sound propagation.
176 
177  /// Enable reflections from image sources that have been added via the \c AK::SpatialAudio::SetImageSource() API. (Does not apply to geometric reflections.)
179 };
180 
181 /// Vertex for a spatial audio mesh.
182 struct AkVertex
183 {
184  /// Constructor
185  AkVertex() : X(0.f), Y(0.f), Z(0.f) {}
186 
187  /// Constructor
188  AkVertex(AkReal32 in_X, AkReal32 in_Y, AkReal32 in_Z) : X(in_X), Y(in_Y), Z(in_Z) {}
189 
190  AkReal32 X; ///< X coordinate
191  AkReal32 Y; ///< Y coordinate
192  AkReal32 Z; ///< Z coordinate
193 };
194 
195 /// Triangle for a spatial audio mesh.
196 struct AkTriangle
197 {
198  /// Constructor
203  {}
204 
205  /// Constructor
206  AkTriangle(AkVertIdx in_pt0, AkVertIdx in_pt1, AkVertIdx in_pt2, AkSurfIdx in_surfaceInfo)
207  : point0(in_pt0)
208  , point1(in_pt1)
209  , point2(in_pt2)
210  , surface(in_surfaceInfo)
211  {}
212 
213  /// Index into the vertex table passed into \c AkGeometryParams that describes the first vertex of the triangle. Triangles are double-sided, so vertex order in not important.
215 
216  /// Index into the vertex table passed into \c AkGeometryParams that describes the second vertex of the triangle. Triangles are double-sided, so vertex order in not important.
218 
219  /// Index into the vertex table passed into \c AkGeometryParams that describes the third vertex of the triangle. Triangles are double-sided, so vertex order in not important.
221 
222  /// Index into the surface table passed into \c AkGeometryParams that describes the surface properties of the triangle.
223  /// If this field is left as \c AK_INVALID_SURFACE, then a default-constructed \c AkAcousticSurface is used.
225 };
226 
227 /// Describes the acoustic surface properties of one or more triangles.
228 /// An single acoustic surface may describe any number of triangles, depending on the granularity desired. For example, if desired for debugging, one could create a unique
229 /// \c AkAcousticSurface struct for each triangle, and define a unique name for each. Alternatively, a single \c AkAcousticSurface could be used to describe all triangles.
230 /// In fact it is not necessary to define any acoustic surfaces at all. If the \c AkTriangle::surface field is left as \c AK_INVALID_SURFACE, then a default-constructed \c AkAcousticSurface is used.
232 {
233  /// Constructor
236  , strName(NULL)
237  {}
238 
239  /// Acoustic texture ShareSet ID for the surface. The acoustic texture is authored in Wwise, and the shareset ID may be obtained by calling \c AK::SoundEngine::GetIDFromString
240  /// \sa <tt>\ref AK::SoundEngine::GetIDFromString()</tt>
242 
243  /// Bitfield of channels that this surface belongs to. When processing the reflections, this bit mask is ANDed with each of the emitter's <tt>reflectorFilterMask</tt>s to determine if the reflector/emitter pair can produce a valid hit.
245 
246  /// Name to describe this surface
247  const char* strName;
248 };
249 
250 /// Structure for retrieving information about the indirect paths of a sound that have been calculated via the geometric reflections API. Useful for debug draw applications.
252 {
253  /// Apparent source of the reflected sound that follows this path.
255 
256  /// Vertices of the indirect path.
257  /// pathPoint[0] is closest to the emitter, pathPoint[numPathPoints-1] is closest to the listener.
259 
260  /// The surfaces that were hit in the path.
261  /// surfaces[0] is closest to the emitter, surfaces[numPathPoints-1] is closest to the listener.
263 
264  /// Number of valid elements in the \c pathPoint[], \c surfaces[], and \c diffraction[] arrays.
266 
267  /// Number of reflections in the \c pathPoint[] array. Shadow zone diffraction does not count as a reflection. If there is no shadow zone diffraction, \c numReflections is equal to \c numPathPoints.
269 
270  /// Diffraction amount, normalized to the range [0,1]
272 
273  /// The point that was hit to cause the path to be occluded. Note that the spatial audio library must be recompiled with \c \#define AK_DEBUG_OCCLUSION to enable generation of occluded paths.
275 
276  /// Linear gain applied to image source.
278 
279  /// True if the sound path was occluded. Note that the spatial audio library must be recompiled with \c \#define AK_DEBUG_OCCLUSION to enable generation of occluded paths.
281 };
282 
283 /// Structure for retrieving information about diffraction paths for a given emitter.
284 /// Both the sound propagation (rooms and portals) system or the geometric diffraction system return infomation in this structure.
286 {
287  /// Defines the maximum number of nodes that a user can retrieve information about. Longer paths will be truncated.
289 
290  /// Diffraction points
292 
293  /// Raw diffraction angles at each point, in radians.
295 
296  /// Virtual emitter position.
298 
299  /// Total number of nodes in the path. Defines the number of valid entries in the \c nodes and \c angles arrays.
301 
302  /// Calculated total diffraction from this path, normalize to the range [0,1]
304 
305  /// Total path length
307 
308  /// Obstruction value for this path.
310 };
311 
312 /// Structure for retrieving information about the sound propagation paths that have been calculated via the rooms and portals API. Useful for debug draw applications.
314 {
315  /// Defines the maximum number of nodes that a user can retrieve information about. Longer paths will be truncated.
317 
318  /// Nodes in the path; they repreent vertices within the bounds of a portal's opening.
320 
321  /// ID of the portal's that the path passes through. portal[0] is the portal closest to the listener; portal[numNodes-1] is the portal closest to the emitter.
323 
324  /// ID's of the rooms that the path passes through. There is always one more room than portal. room[0] is the listener's room; the emitters room is room[numNodes].
326 
327  /// Represents the number of valid nodes in nodePoint[] and the number of valid portals in portals[]. The number of rooms in rooms[] is numNodes+1. There is always one more room than portal.
329 
330  /// The sum of all straight line path segments, including the segment from the listener to nodePoint[0], between each subsequent nodePoint, and from nodePoint[numNodes-1] to the emitter.
332 
333  /// The cumulative gain (linear) of all portals traversed.
335 
336  /// The dry diffraction amount is normalized in the range [0,1], and calculated from the maximum deviation angle from a straight line, of all angles at each nodePoint. Can be thought of as how
337  // far into the 'shadow region' the sound has to 'bend' to reach the listener.
338  /// Depending on the spatial audio initialization settings, this value that is applied internally, by spatial audio, to the obstruction or built-in parameter of the emitter game object.
339  /// \sa
340  /// - \ref AkDiffractionFlags
341  /// - \ref AkSpatialAudioInitSettings
343 
344  /// The wet diffraction amount for the portal closest to the listener, normalized in the range [0,1].
345  /// The wet diffraction is calculated from how far into the 'shadow region' the listener is from the closest portal. Unlike dry diffraction, the
346  /// wet diffraction does not depend on the incident angle, but only the normal of the portal.
347  /// Depending on the spatial audio initialization settings, this value that is applied internally, by spatial audio, to the obstruction/built-in parameter of the room game object that is
348  /// on the other side of the portal closest to the listener.
349  /// \sa
350  /// - \ref AkDiffractionFlags
351  /// - \ref AkSpatialAudioInitSettings
353 };
354 
355 /// Parameters passed to \c SetPortal
357 {
358  /// Constructor
360  bEnabled(false)
361  {}
362 
363  /// Portal's position and orientation in the 3D world.
364  /// Position vector is the center of the opening.
365  /// OrientationFront vector must be unit-length and point along the normal of the portal, and must be orthogonal to Up. It defines the local positive-Z dimension (depth/transition axis) of the portal, used by Extent.
366  /// OrientationTop vector must be unit-length and point along the top of the portal (tangent to the wall), must be orthogonal to Front. It defines the local positive-Y direction (height) of the portal, used by Extent.
368 
369  /// Portal extent. Defines the dimensions of the portal relative to its center; all components must be positive numbers. The local X and Y dimensions (side and top) are used in diffraction calculations,
370  /// whereas the Z dimension (front) defines a depth value which is used to implement smooth transitions between rooms. It is recommended that users experiment with different portal depths to find a value
371  /// that results in appropriately smooth transitions between rooms.
373 
374  /// Whether or not the portal is active/enabled. For example, this parameter may be used to simulate open/closed doors.
375  /// Portal diffraction is simulated when at least one portal exists and is active between an emitter and the listener. Otherwise, transmission is simulated.
376  /// Diffraction uses obstruction or the diffraction built-in game parameter, while transmission uses occlusion.
377  bool bEnabled;
378 
379  /// Name used to identify portal (optional).
381 
382  /// ID of the room to which the portal connects, in the direction of the Front vector. If a room with this ID has not been added via AK::SpatialAudio::SetRoom,
383  /// a room will be created with this ID and with default AkRoomParams. If you would later like to update the AkRoomParams, simply call AK::SpatialAudio::SetRoom again with this same ID.
384  /// - \ref AK::SpatialAudio::SetRoom
385  /// - \ref AK::SpatialAudio::RemoveRoom
386  /// - \ref AkRoomParams
388 
389  /// ID of the room to which the portal connects, in the direction opposite to the Front vector. If a room with this ID has not been added via AK::SpatialAudio::SetRoom,
390  /// a room will be created with this ID and with default AkRoomParams. If you would later like to update the AkRoomParams, simply call AK::SpatialAudio::SetRoom again with this same ID.
391  /// - \ref AK::SpatialAudio::SetRoom
392  /// - \ref AK::SpatialAudio::RemoveRoom
393  /// - \ref AkRoomParams
395 };
396 
397 /// Parameters passed to \c SetRoom
399 {
400  /// Constructor
402  , ReverbLevel(1.f)
403  , WallOcclusion(1.f)
406 
407  {
408  Up.X = 0.f;
409  Up.Y = 1.f;
410  Up.Z = 0.f;
411  Front.X = 0.f;
412  Front.Y = 0.f;
413  Front.Z = 1.f;
414  }
415 
416  /// Room Orientation. Up and Front must be orthonormal.
417  /// Room orientation has an effect when the associated aux bus (see ReverbAuxBus) is set with 3D Spatialization in Wwise, as 3D Spatialization implements relative rotation of the emitter (room) and listener.
420 
421  /// The reverb aux bus that is associated with this room.
422  /// When Spatial Audio is told that a game object is in a particular room via SetGameObjectInRoom, a send to this aux bus will be created to model the reverb of the room.
423  /// Using a combination of Rooms and Portals, Spatial Audio manages which game object the aux bus is spawned on, and what control gain is sent to the bus.
424  /// When a game object is inside a connected portal, as defined by the portal's orientation and extent vectors, both this aux send and the aux send of the adjacent room are active.
425  /// Spatial audio modulates the control value for each send based on the game object's position, in relation to the portal's z-azis and extent, to crossfade the reverb between the two rooms.
426  /// If more advanced control of reverb is desired, SetEmitterAuxSendValues can be used to add additional sends on to a game object.
427  /// - \ref AK::SpatialAudio::SetGameObjectInRoom
428  /// - \ref AK::SpatialAudio::SetEmitterAuxSendValues
430 
431  /// The reverb control value for the send to ReverbAuxBus. Valid range: (0.f-1.f)
432  /// Can be used to implement multiple rooms that share the same aux bus, but have different reverb levels.
434 
435  /// Occlusion level to set when modeling transmission through walls. Transmission is modeled only when no sound propagation paths to the listener are found, meaning that there are no active portals between the listener's
436  /// room and the emitter's room. Valid range: (0.f-1.f)
438 
439  /// Name used to identify room (optional)
441 
442  /// Send level for sounds that are posted on the room game object; adds reverb to ambience and room tones. Valid range: (0.f-1.f). Set to a value greater than 0 to have spatial audio create a send on the room game object,
443  /// where the room game object itself is specified as the listener and ReverbAuxBus is specified as the aux bus. A value of 0 disables the aux send. This should not be confused with ReverbLevel, which is the send level
444  /// for spatial audio emitters sending to the room game object.
445  /// \aknote The room game object can be accessed though the ID that is passed to \c SetRoom() and the \c AkRoomID::AsGameObjectID() method. Posting an event on the room game object leverages automatic room game object placement
446  /// by spatial audio so that when the listener is inside the room, the sound comes from all around the listener, and when the listener is outside the room, the sound comes from the portal(s). Typically, this would be used for
447  /// surround ambiance beds or room tones. Point source sounds should use separate game objects that are registered as spatial audio emitters.
448  /// \sa
449  /// - \ref AkRoomParams::RoomGameObj_KeepRegistered
450  /// - \ref AkRoomID
452 
453  /// If set to true, the room game object will be registered on calling \c SetRoom(), and not released untill the room is deleted or removed with \c RemoveRoom(). If set to false, spatial audio will register
454  /// the room object only when it is needed by the sound propagation system for the purposes of reverb, and will unregister the game object when all reverb tails have finished.
455  /// If the game intends to post events on the room game object for the purpose of ambiance or room tones, RoomGameObj_KeepRegistered should be set to true.
456  /// \aknote The room game object can be accessed though the ID that is passed to \c SetRoom() and the \c AkRoomID::AsGameObjectID() method. Posting an event on the room game object leverages automatic room game object placement
457  /// by spatial audio so that when the listener is inside the room, the sound comes from all around the listener, and when the listener is outside the room, the sound comes from the portal(s). Typically, this would be used for
458  /// surround ambiance beds or room tones. Point source sounds should use separate game objects that are registered as spatial audio emitters.
459  /// \sa
460  /// - \ref AkRoomParams::RoomGameObj_AuxSendLevelToSelf
461  /// - \ref AkRoomID
463 
464 
465 };
466 
467 /// Parameters passed to \c SetGeometry
469 {
470  /// Constructor
472 
473  /// Pointer to an array of AkTriangle structures.
474  /// This array will be copied into the spatial audio memory pool and will not be accessed after \c SetGeometry returns.
475  /// - \ref AkTriangle
476  /// - \ref AK::SpatialAudio::SetGeometry
477  /// - \ref AK::SpatialAudio::RemoveGeometry
479 
480  /// Number of triangles in Triangles.
482 
483  /// Pointer to an array of AkVertex structures.
484  /// This array will be copied into the spatial audio memory pool and will not be accessed after \c SetGeometry returns.
485  /// - \ref AkVertex
486  /// - \ref AK::SpatialAudio::SetGeometry
487  /// - \ref AK::SpatialAudio::RemoveGeometry
489 
490  ///< Number of vertices in Vertices.
492 
493  ///< Pointer to an array of AkAcousticSurface structures.
494  /// This array will be copied into the spatial audio memory pool and will not be accessed after \c SetGeometry returns.
495  /// - \ref AkVertex
496  /// - \ref AK::SpatialAudio::SetGeometry
497  /// - \ref AK::SpatialAudio::RemoveGeometry
499 
500  /// Number of of AkTriangleInfo structures in in_pTriangleInfo and number of AkTriIdx's in in_infoMap.
502 
503  /// Switch to enable or disable geometric diffraction for this Geometry.
505 
506  /// Switch to enable or disable geometric diffraction on boundary edges for this Geometry. Boundary edges are edges that are connected to only one triangle.
508 };
509 
510 /// Audiokinetic namespace
511 namespace AK
512 {
513  /// Audiokinetic spatial audio namespace
514  namespace SpatialAudio
515  {
516  ////////////////////////////////////////////////////////////////////////
517  /// @name Basic functions.
518  /// In order to use SpatialAudio, you need to initalize it using Init, and register all emitters and listeners that you plan on using with any of the services offered by SpatialAudio, using
519  /// RegisterEmitter and RegisterListener respectively, _after_ having registered their corresponding game object to the sound engine. The position of these objects and game-defined sends should be updated with
520  /// SetPosition and SetEmitterAuxSendValues instead of their AK::SoundEngine counterparts.
521  ///\akwarning At the moment, there can be only one Spatial Audio listener registered at any given time.
522  //@{
523 
524  /// Access the internal pool ID passed to Init.
526 
527  /// Initialize the SpatialAudio API.
528  AK_EXTERNAPIFUNC(AKRESULT, Init)(const AkSpatialAudioInitSettings& in_initSettings);
529 
530  /// Register a game object as a sound emitter in the SpatialAudio API or update settings on a previously registered sound emitter. The game object must have already been
531  /// registered in the sound engine via \c AK::SoundEngine::RegisterGameObj().
532  /// \sa
533  /// - \ref AkEmitterSettings
535  AkGameObjectID in_gameObjectID, ///< Game object ID
536  const AkEmitterSettings& in_settings ///< Settings for the spatial audio emitter.
537  );
538 
539  /// Unregister a game object as a sound emitter in the SpatialAudio API; clean up Spatial Audio listener data associated with in_gameObjectID.
540  /// This function is optional - emitters are automatically unregistered when their game object is deleted in the sound engine.
541  /// \sa
542  /// - \ref AK::SpatialAudio::RegisterEmitter
544  AkGameObjectID in_gameObjectID ///< Game object ID
545  );
546 
547  /// Assign a game object as the Spatial Audio listener. There can be only one Spatial Audio listener registered at any given time; in_gameObjectID will replace any previously set Spatial Audio listener.
548  /// The game object passed in must be registered by the client, at some point, for sound to be heard. It is not necessary to be registered at the time of calling this function.
549  /// If not listener is explicitly registered to spatial audio, then a default listener (set via \c AK::SoundEngine::SetDefaultListeners()) is selected. If the are no default listeners, or there are more than one
550  /// default listeners, then it is necessary to call RegisterListener() to specify which listener to use with Spatial Audio.
552  AkGameObjectID in_gameObjectID ///< Game object ID
553  );
554 
555  /// Unregister a game object as a listener in the SpatialAudio API; clean up Spatial Audio listener data associated with in_gameObjectID.
556  /// If in_gameObjectID is the current registered listener, calling this function will clear the Spatial Audio listener and
557  /// Spatial Audio features will be disabled until another listener is registered.
558  /// This function is optional - listener are automatically unregistered when their game object is deleted in the sound engine.
559  /// \sa
560  /// - \ref AK::SpatialAudio::RegisterListener
562  AkGameObjectID in_gameObjectID ///< Game object ID
563  );
564 
565  /// Set the position of an emitter game object that has been registered with the SpatialAudio API.
566  /// This function should be called instead of \c AK::SoundEngine::SetPosition(). The argument \c in_sourcePosition should represent the real position of the emitter. It is this position that is used
567  /// for all spatial audio services, such as Rooms and GeometrySets (see SpatialAudio::SetRoom and SpatialAudio::SetGeometry).
568  /// When an emitter is in a different room from the listener, its virtual positions are automatically calculated based on the relative positions of the listener and nearby portals, and it is these virtual positions
569  /// that are passed to the sound engine and used to render audio.
570  /// If the game object is registered with the sound engine, but not with the SpatialAudio API, then the call will be passed on to AK::SoundEngine::SetPosition().
572  AkGameObjectID in_gameObjectID, ///< Game object ID of the sound emitter.
573  const AkTransform& in_sourcePosition ///< Physical position of the emitter in the simulation.
574  );
575 
576  /// Set the aux send values for an emitter game object that has been registered with the SpatialAudio API.
577  /// This function should be called instead of \c AK::SoundEngine::SetGameObjectAuxSendValues() because the spatial audio API adds additional sends for room's late reverb and
578  // for early reflection processing.
579  /// If the game object is registered with the sound engine, but not with the SpatialAudio API, then the call will be passed on to \c AK::SoundEngine::SetGameObjectAuxSendValues().
580  /// \sa
581  /// - \ref AK::SoundEngine::SetGameObjectAuxSendValues
583  AkGameObjectID in_gameObjectID, ///< Game object ID of the sound emitter.
584  AkAuxSendValue* in_pAuxSends, ///< Aux send values
585  AkUInt32 in_uNumAux ///< Number of elements in in_pAuxSends
586  );
587 
588  //@}
589 
590  ////////////////////////////////////////////////////////////////////////
591  /// @name Helper functions for passing game data to the Wwise Reflect plug-in.
592  /// Use this API for detailed placement of reflection image sources.
593  /// \aknote These functions are low-level and useful when your game engine already implements a geometrical approach to sound propagation such as an image-source or a ray tracing algorithm.
594  /// Functions of Geometry are preferred and easier to use with the Wwise Reflect plug-in. \endaknote
595  //@{
596 
597  /// Add or update an individual image source for processing via the AkReflect plug-in. Use this API for detailed placement of
598  /// reflection image sources, whose positions have been determined by the client, such as from the results of a ray cast, computation or by manual placement. One possible
599  /// use case is generating reflections that originate far enough away that they can be modeled as a static point source, for example, off of a distant mountain.
600  /// The SpatialAudio API manages image sources added via SetImageSource() and sends them to the AkReflect plug-in that is on the aux bus with ID \c in_AuxBusID.
601  /// The image source will apply to all registered spatial audio emitters, if \c AK_INVALID_GAME_OBJECT is passed for \c in_gameObjectID,
602  /// or to one particular game object, if \c in_gameObjectID contains the ID of a valid registered spatial audio emitter.
603  /// SetImageSource takes a room ID to indicate which room the reflection is logically part of, even though the position of the image source may be outside of the extents of the room.
604  /// This ID is used as a filter, so that it is not possible to hear reflections for rooms that the emitter is not inside. To use this feature, the emitter and listeners rooms must be
605  /// specified using SetGameObjectInRoom. If you are not using the rooms and portals API, or the image source is not associated with a room, pass a default-constructed room ID.
606  /// \aknote The \c AkImageSourceSettings struct passed in \c in_info must contain a unique image source ID to be able to identify this image source across frames and when updating and/or removing it later.
607  /// Each instance of AkReflect has its own set of data, so you may reuse ID, if desired, as long as \c in_gameObjectID and \c in_AuxBusID are different.
608  /// If you are using the geometric reflections API on the same aux bus (as set in \c AkEmitterSettings) and game object(s), there is a small chance of ID conflict, because IDs for
609  /// geometric reflections' image sources are generated internally using a hash function. If a conflict does occur, you will only hear one of the two reflections. \endaknote
610  /// \aknote For proper operation with AkReflect and the SpatialAudio API, any aux bus using AkReflect should have 'Listener Relative Routing' checked and the 3D Spatialization set to None in the Wwise authoring tool. See \ref spatial_audio_wwiseprojectsetup_businstances for more details. \endaknote
611  /// \sa
612  /// - \ref AK::SpatialAudio::RegisterEmitter
613  /// - \ref AK::SpatialAudio::RemoveImageSource
614  /// - \ref AK::SpatialAudio::SetGameObjectInRoom
616  AkImageSourceID in_srcID, ///< The ID of the image source being added.
617  const AkImageSourceSettings& in_info, ///< Image source information.
618  AkUniqueID in_AuxBusID, ///< Aux bus that has the AkReflect plug in for early reflection DSP.
619  AkRoomID in_roomID, ///< The ID of the room that the image source is logically a part of; pass a default-constructed ID if not in, or not using, a room.
620  AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT ///< The ID of the emitter game object to which the image source applies. Pass AK_INVALID_GAME_OBJECT to apply to all emitter game objects.
621  );
622 
623  /// Remove an individual reflection image source that was previously added via \c SetImageSource.
624  /// \sa
625  /// - \ref AK::SpatialAudio::SetImageSource
627  AkImageSourceID in_srcID, ///< The ID of the image source to remove.
628  AkUniqueID in_AuxBusID, ///< Aux bus that was passed to SetImageSource.
629  AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT ///< Game object ID that was passed to SetImageSource.
630  );
631 
632  //@}
633 
634  ////////////////////////////////////////////////////////////////////////
635  /// @name Geometry
636  /// Geometry API for early reflection processing using Wwise Reflect.
637  //@{
638 
639  /// Add or update a set of geometry from the \c SpatialAudio module for geometric reflection and diffaction processing. A geometry set is a logical set of vertices, triangles, and acoustic surfaces,
640  /// which are referenced by the same \c AkGeometrySetID. The ID (\c in_GeomSetID) must be unique and is also chosen by the client in a manner similar to \c AkGameObjectID's.
641  /// \sa
642  /// - \ref AkGeometryParams
643  /// - \ref AK::SpatialAudio::RemoveGeometry
645  AkGeometrySetID in_GeomSetID, ///< Unique geometry set ID, chosen by client.
646  const AkGeometryParams& in_params ///< Geometry parameters to set.
647  );
648 
649  /// Remove a set of geometry to the SpatialAudio API.
650  /// \sa
651  /// - \ref AK::SpatialAudio::SetGeometry
653  AkGeometrySetID in_SetID ///< ID of geometry set to be removed.
654  );
655 
656  /// Query information about the reflection paths that have been calculated via geometric reflection processing in the SpatialAudio API. This function can be used for debugging purposes.
657  /// This function must acquire the global sound engine lock and therefore, may block waiting for the lock.
658  /// \sa
659  /// - \ref AkReflectionPathInfo
661  AkGameObjectID in_gameObjectID, ///< The ID of the game object that the client wishes to query.
662  AkVector& out_listenerPos, ///< Returns the position of the listener game object that is associated with the game object \c in_gameObjectID.
663  AkVector& out_emitterPos, ///< Returns the position of the emitter game object \c in_gameObjectID.
664  AkReflectionPathInfo* out_aPaths, ///< Pointer to an array of \c AkReflectionPathInfo's which will be filled after returning.
665  AkUInt32& io_uArraySize ///< The number of slots in \c out_aPaths, after returning the number of valid elements written.
666  );
667 
668  //@}
669 
670  ////////////////////////////////////////////////////////////////////////
671  /// @name Rooms and Portals
672  /// Sound Propagation API using rooms and portals.
673  //@{
674 
675  /// Add or update a room. Rooms are used to connect portals and define an orientation for oriented reverbs. This function may be called multiple times with the same ID to update the parameters of the room.
676  /// The ID (\c in_RoomID) must be chosen in the same manner as \c AkGameObjectID's, as they are in the same ID-space. The spatial audio lib manages the
677  /// registration/unregistration of internal game objects for rooms that use these IDs and, therefore, must not collide.
678  /// \sa
679  /// - \ref AkRoomID
680  /// - \ref AkRoomParams
681  /// - \ref AK::SpatialAudio::RemoveRoom
683  AkRoomID in_RoomID, ///< Unique room ID, chosen by the client.
684  const AkRoomParams& in_Params ///< Parameter for the room.
685  );
686 
687  /// Remove a room.
688  /// \sa
689  /// - \ref AkRoomID
690  /// - \ref AK::SpatialAudio::SetRoom
692  AkRoomID in_RoomID ///< Room ID that was passed to \c SetRoom.
693  );
694 
695  /// Add or update an acoustic portal. A portal is an opening that connects two or more rooms to simulate the transmission of reverberated (indirect) sound between the rooms.
696  /// This function may be called multiple times with the same ID to update the parameters of the portal. The ID (\c in_PortalID) must be chosen in the same manner as \c AkGameObjectID's,
697  /// as they are in the same ID-space. The spatial audio lib manages the registration/unregistration of internal game objects for portals that use these IDs, and therefore must not collide.
698  /// \sa
699  /// - \ref AkPortalID
700  /// - \ref AkPortalParams
701  /// - \ref AK::SpatialAudio::RemovePortal
703  AkPortalID in_PortalID, ///< Unique portal ID, chosen by the client.
704  const AkPortalParams& in_Params ///< Parameter for the portal.
705  );
706 
707  /// Remove a portal.
708  /// \sa
709  /// - \ref AkPortalID
710  /// - \ref AK::SpatialAudio::SetPortal
712  AkPortalID in_PortalID ///< ID of portal to be removed, which was originally passed to SetPortal.
713  );
714 
715  /// Set the room that the game object is currently located in - usually the result of a containment test performed by the client. The room must have been registered with \c SetRoom.
716  /// Setting the room for a game object provides the basis for the sound propagation service, and also sets which room's reverb aux bus to send to. The sound propagation service traces the path
717  /// of the sound from the emitter to the listener, and calculates the diffraction as the sound passes through each portal. The portals are used to define the spatial location of the diffracted and reverberated
718  /// audio.
719  /// \sa
720  /// - \ref AK::SpatialAudio::SetRoom
721  /// - \ref AK::SpatialAudio::RemoveRoom
723  AkGameObjectID in_gameObjectID, ///< Game object ID
724  AkRoomID in_CurrentRoomID ///< RoomID that was passed to \c AK::SpatialAudio::SetRoom
725  );
726 
727  /// Set the obstruction and occlusion values of an emitter game object that has been registered with the SpatialAudio API.
728  /// This function should be called instead of \c AK::SoundEngine::SetObjectObstructionAndOcclusion(), and can be used for setting the obstruction and occlusion values on a Spatial Audio emitter.
729  /// The obstruction value passed to SetEmitterObstructionAndOcclusion() should be used to simulate obstructing objects between the emitter and the listener, if they are in the same room, or between the emitter and a portal, if the emitter
730  /// and listener are in different room.
731  /// The occlusion value that is passed to SetEmitterObstructionAndOcclusion() is send to the sound engine directly, unless the emitter is unreachable via sound propagation. In this case, the occlusion value is maxed with the \c AkRoomParams::WallOcclusion value
732  /// to simulate sound transmission through walls.
733  /// If the listener and the emitter are in different rooms, the maximum of the obstruction value passed into SetEmitterObstructionAndOcclusion() and the the obstruction value calculated from the diffraction angle is passed to the sound engine.
734  /// If the game object is not registered as an emitter with Spatial Audio, then an error will be reported, and the call will have no effect.
735  /// \aknote The game is responsible to differentiate between obstruction between the emitter and the portal (where \c AK::SpatialAudio::SetEmitterObstructionAndOcclusion() should be used), and occlusion from room boundaries,
736  /// which is better handled by the spatial audio diffraction system. For example, games that use ray-testing for obstruction may report 100 % obstruction when an object is very close to the opening of a portal,
737  /// because the ray between the emitter and the listener hits a nearby wall. If the game then sends 100 %, this will erroneously override the diffraction calculation which is probably much less than 100% (180 degrees),
738  /// and better matches the expected audibility of the sound. To prevent this scenario, games can ray-test for obstruction objects between the emitter and the portal, passing the results with \c AK::SpatialAudio::SetEmitterObstructionAndOcclusion(),
739  /// and then test for obstructing objects between the portal and the listener, passing the results with \c AK::SpatialAudio::SetPortalObstructionAndOcclusion().
740  /// \sa
741  /// - \ref AK::SpatialAudio::SetPortalObstructionAndOcclusion
743  AkGameObjectID in_gameObjectID, ///< Game object ID of the sound emitter.
744  AkReal32 in_fObstruction, ///< Obstruction value. Valid range 0.f-1.f
745  AkReal32 in_fOcclusion ///< Occlusion value. Valid range 0.f-1.f
746  );
747 
748  /// Set the obstruction and occlusion value for a portal that has been registered with Spatial Audio.
749  /// Portal obstruction is used to simulate objects between the portal and the listener that are obstructing the sound coming from the portal.
750  /// The obstruction value affects only the portals dry path, and should relate to how much of the opening
751  /// is obstructed, and must be calculated by the client. It is applied to the room's game object, as well as to all the emitters virtual positions
752  /// which propagate from that room through this portal.
753  /// Portal occlusion is applied only on the room game object, and affects both the wet and dry path of the signal emitted from the room's bus.
754  /// \sa
755  /// - \ref AK::SpatialAudio::SetEmitterObstructionAndOcclusion
757  AkPortalID in_PortalID, ///< Portal ID.
758  AkReal32 in_fObstruction, ///< Obstruction value. Valid range 0.f-1.f
759  AkReal32 in_fOcclusion ///< Occlusion value. Valid range 0.f-1.f
760  );
761 
762  /// Query information about the sound propagation state for a particular listener and emitter, which has been calculated using the data provided via the rooms and portals API. This function can be used for debugging purposes.
763  /// This function must acquire the global sound engine lock and therefore, may block waiting for the lock.
764  /// \sa
765  /// - \ref AkPropagationPathInfo
767  AkGameObjectID in_gameObjectID, ///< The ID of the game object that the client wishes to query.
768  AkVector& out_listenerPos, ///< Returns the position of the listener game object that is associated with the game object \c in_gameObjectID.
769  AkVector& out_emitterPos, ///< Returns the position of the emitter game object \c in_gameObjectID.
770  AkPropagationPathInfo* out_aPaths, ///< Pointer to an array of \c AkPropagationPathInfo's which will be filled after returning.
771  AkUInt32& io_uArraySize ///< The number of slots in \c out_aPaths, after returning the number of valid elements written.
772  );
773 
774  /// Query information about the diffraction state for a particular listener and emitter, which has been calculated using the data provided via the spatial audio emitter API. This function can be used for debugging purposes.
775  /// This function must acquire the global sound engine lock and therefore, may block waiting for the lock.
776  /// \sa
777  /// - \ref AkDiffractionPathInfo
779  AkGameObjectID in_gameObjectID, ///< The ID of the game object that the client wishes to query.
780  AkVector& out_listenerPos, ///< Returns the position of the listener game object that is associated with the game object \c in_gameObjectID.
781  AkVector& out_emitterPos, ///< Returns the position of the emitter game object \c in_gameObjectID.
782  AkDiffractionPathInfo* out_aPaths, ///< Pointer to an array of \c AkPropagationPathInfo's which will be filled after returning.
783  AkUInt32& io_uArraySize ///< The number of slots in \c out_aPaths, after returning the number of valid elements written.
784  );
785 
786  //@}
787  }
788 };
AkAcousticSurface()
Constructor
Definition: AkSpatialAudio.h:234
AKRESULT __cdecl QuerySoundPropagationPaths(AkGameObjectID in_gameObjectID, AkVector &out_listenerPos, AkVector &out_emitterPos, AkPropagationPathInfo *out_aPaths, AkUInt32 &io_uArraySize)
AKRESULT __cdecl SetPosition(AkGameObjectID in_gameObjectID, const AkTransform &in_sourcePosition)
Structure for retrieving information about the sound propagation paths that have been calculated via ...
Definition: AkSpatialAudio.h:313
AkUniqueID reflectAuxBusID
Definition: AkSpatialAudio.h:138
void SetOneTexture(AkUniqueID in_texture)
Definition: AkSpatialAudio.h:94
AkUInt32 reflectionsOrder
Definition: AkSpatialAudio.h:149
AKRESULT __cdecl SetEmitterAuxSendValues(AkGameObjectID in_gameObjectID, AkAuxSendValue *in_pAuxSends, AkUInt32 in_uNumAux)
AkUInt32 AkAuxBusID
Auxilliary bus ID
Definition: AkTypes.h:75
AkPortalID portals[kMaxNodes]
ID of the portal's that the path passes through. portal[0] is the portal closest to the listener; por...
Definition: AkSpatialAudio.h:322
AkUInt16 AkSurfIdx
AKRESULT __cdecl RemoveRoom(AkRoomID in_RoomID)
AkUInt32 numPathPoints
Number of valid elements in the pathPoint[], surfaces[], and diffraction[] arrays.
Definition: AkSpatialAudio.h:265
AkAcousticSurface surfaces[AK_MAX_REFLECTION_PATH_LENGTH]
Definition: AkSpatialAudio.h:262
AkTriangle(AkVertIdx in_pt0, AkVertIdx in_pt1, AkVertIdx in_pt2, AkSurfIdx in_surfaceInfo)
Constructor
Definition: AkSpatialAudio.h:206
AkUniqueID arTextureID[AK_MAX_NUM_TEXTURE]
Unique IDs of the Acoustics Texture ShareSets used to filter this image source.
AkReal32 wetDiffraction
Definition: AkSpatialAudio.h:352
AkUInt32 AkImageSourceID
Image Source ID
Definition: AkTypes.h:93
static const AkAuxBusID AK_INVALID_AUX_ID
Invalid auxiliary bus ID (or no Aux bus ID)
Definition: AkTypes.h:105
Parameters passed to SetPortal
Definition: AkSpatialAudio.h:356
Triangle for a spatial audio mesh.
Definition: AkSpatialAudio.h:196
AkVector nodes[kMaxNodes]
Diffraction points
Definition: AkSpatialAudio.h:291
AkReal32 reflectionsAuxBusGain
Send gain (0.f-1.f) that is applied when sending to the bus that has the AkReflect plug-in....
Definition: AkSpatialAudio.h:145
AkEmitterSettings()
Constructor
Definition: AkSpatialAudio.h:120
AK::SpatialAudio::OsString strName
Name used to identify portal (optional).
Definition: AkSpatialAudio.h:380
AkMemPoolId uPoolID
User-provided pool ID (see AK::MemoryMgr::CreatePool).
Definition: AkSpatialAudio.h:57
AkPortalParams()
Constructor
Definition: AkSpatialAudio.h:359
AKRESULT
Standard function call result.
Definition: AkTypes.h:126
AkGeometryParams()
Constructor
Definition: AkSpatialAudio.h:471
AkReal32 RoomGameObj_AuxSendLevelToSelf
Definition: AkSpatialAudio.h:451
AkAuxBusID ReverbAuxBus
Definition: AkSpatialAudio.h:429
AkRoomParams()
Constructor
Definition: AkSpatialAudio.h:401
uint8_t AkUInt8
Unsigned 8-bit integer
Definition: AkTypes.h:77
AKRESULT __cdecl RegisterEmitter(AkGameObjectID in_gameObjectID, const AkEmitterSettings &in_settings)
AkReal32 angles[kMaxNodes]
Raw diffraction angles at each point, in radians.
Definition: AkSpatialAudio.h:294
AKRESULT __cdecl QueryReflectionPaths(AkGameObjectID in_gameObjectID, AkVector &out_listenerPos, AkVector &out_emitterPos, AkReflectionPathInfo *out_aPaths, AkUInt32 &io_uArraySize)
AK::SpatialAudio::OsString name
Name given to this sound emitter.
Definition: AkSpatialAudio.h:134
AkSurfIdx surface
Definition: AkSpatialAudio.h:224
Audiokinetic namespace
AkVector occlusionPoint
The point that was hit to cause the path to be occluded. Note that the spatial audio library must be ...
Definition: AkSpatialAudio.h:274
AkUInt16 AkVertIdx
AkVertIdx point2
Index into the vertex table passed into AkGeometryParams that describes the third vertex of the trian...
Definition: AkSpatialAudio.h:220
AkUInt32 uNumTexture
Number of valid textures in the texture array.
AkVector Up
Definition: AkSpatialAudio.h:418
AkUInt32 reflectorFilterMask
Definition: AkSpatialAudio.h:154
AkReal32 X
X Position
Definition: AkTypes.h:328
#define AK_EXTERNAPIFUNC(__TYPE__, __NAME__)
AkReal32 diffraction
Calculated total diffraction from this path, normalize to the range [0,1]
Definition: AkSpatialAudio.h:303
AkAcousticSurface * Surfaces
Definition: AkSpatialAudio.h:498
AKRESULT __cdecl SetGeometry(AkGeometrySetID in_GeomSetID, const AkGeometryParams &in_params)
AkReal32 reflectionMaxPathLength
Definition: AkSpatialAudio.h:142
AkTransform Transform
Definition: AkSpatialAudio.h:367
AKRESULT __cdecl SetGameObjectInRoom(AkGameObjectID in_gameObjectID, AkRoomID in_CurrentRoomID)
AkReal32 fDiffractionShadowAttenFactor
Multiplier that is applied to the distance attenuation of diffracted sounds (sounds that are in the '...
Definition: AkSpatialAudio.h:61
AKRESULT __cdecl SetRoom(AkRoomID in_RoomID, const AkRoomParams &in_Params)
AkRoomID rooms[kMaxNodes+1]
ID's of the rooms that the path passes through. There is always one more room than portal....
Definition: AkSpatialAudio.h:325
AkMemPoolId __cdecl GetPoolID()
Access the internal pool ID passed to Init.
Settings for a sound emitter.
Definition: AkSpatialAudio.h:117
bool EnableDiffraction
Switch to enable or disable geometric diffraction for this Geometry.
Definition: AkSpatialAudio.h:504
AkTriIdx NumTriangles
Number of triangles in Triangles.
Definition: AkSpatialAudio.h:481
AkDiffractionFlags
AkDiffractionFlags determine if diffraction values for sound passing through portals will be calculat...
Definition: AkSpatialAudio.h:37
AkTriangle * Triangles
Definition: AkSpatialAudio.h:478
const char * strName
Name to describe this surface
Definition: AkSpatialAudio.h:247
Auxiliary bus sends information per game object per given auxiliary bus.
Definition: AkTypes.h:594
bool EnableDiffractionOnBoundaryEdges
Switch to enable or disable geometric diffraction on boundary edges for this Geometry....
Definition: AkSpatialAudio.h:507
AKRESULT __cdecl RemoveImageSource(AkImageSourceID in_srcID, AkUniqueID in_AuxBusID, AkGameObjectID in_gameObjectID=AK_INVALID_GAME_OBJECT)
AkUInt32 textureID
Definition: AkSpatialAudio.h:241
Use Wwise obstruction for dry-path diffraction. Dry-path diffraction is related to the angle off of a...
Definition: AkSpatialAudio.h:40
AkUInt32 diffractionMaxEdges
Definition: AkSpatialAudio.h:166
AkReal32 diffraction[AK_MAX_REFLECTION_PATH_LENGTH]
Diffraction amount, normalized to the range [0,1]
Definition: AkSpatialAudio.h:271
const AkReal32 kDefaultMaxPathLength
AkUInt32 AkUniqueID
Unique 32-bit ID
Definition: AkTypes.h:62
AkReal32 X
X coordinate
Definition: AkSpatialAudio.h:190
AkUInt32 reflectorChannelMask
Bitfield of channels that this surface belongs to. When processing the reflections,...
Definition: AkSpatialAudio.h:244
AkImageSourceSettings(AkVector in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
Definition: AkSpatialAudio.h:72
AkImageSourceParams params
Image source parameters.
Definition: AkSpatialAudio.h:107
AKRESULT __cdecl Init(const AkSpatialAudioInitSettings &in_initSettings)
Initialize the SpatialAudio API.
AkReal32 WallOcclusion
Definition: AkSpatialAudio.h:437
AkUInt64 AkGameObjectID
Game object ID
Definition: AkTypes.h:70
AkReal32 ReverbLevel
Definition: AkSpatialAudio.h:433
AkReal32 fDiffractionShadowDegrees
Definition: AkSpatialAudio.h:62
AkUInt32 diffractionMaxPaths
Definition: AkSpatialAudio.h:171
AkUInt32 uDiffractionFlags
Enable or disable specific diffraction features. See AkDiffractionFlags.
Definition: AkSpatialAudio.h:60
AK::SpatialAudio::OsString strName
Name used to identify room (optional)
Definition: AkSpatialAudio.h:440
AkReal32 length
The sum of all straight line path segments, including the segment from the listener to nodePoint[0],...
Definition: AkSpatialAudio.h:331
AKRESULT __cdecl RemovePortal(AkPortalID in_PortalID)
bool isOccluded
True if the sound path was occluded. Note that the spatial audio library must be recompiled with #def...
Definition: AkSpatialAudio.h:280
Initialization settings of the spatial audio module.
Definition: AkSpatialAudio.h:47
AKRESULT __cdecl UnregisterListener(AkGameObjectID in_gameObjectID)
void SetName(const char *in_pName)
Definition: AkSpatialAudio.h:100
AKRESULT __cdecl SetEmitterObstructionAndOcclusion(AkGameObjectID in_gameObjectID, AkReal32 in_fObstruction, AkReal32 in_fOcclusion)
AkRoomID FrontRoom
Definition: AkSpatialAudio.h:387
AkReal32 obstructionValue
Obstruction value for this path.
Definition: AkSpatialAudio.h:309
#define NULL
Definition: AkTypes.h:49
AkUInt32 numNodes
Represents the number of valid nodes in nodePoint[] and the number of valid portals in portals[]....
Definition: AkSpatialAudio.h:328
AkUInt32 uMaxSoundPropagationDepth
Maximum number of portals that sound can propagate through; must be less than or equal to AK_MAX_SOUN...
Definition: AkSpatialAudio.h:59
AkRoomID BackRoom
Definition: AkSpatialAudio.h:394
AkReal32 Z
Z coordinate
Definition: AkSpatialAudio.h:192
void Term()
Definition: AkString.h:40
AKRESULT __cdecl SetImageSource(AkImageSourceID in_srcID, const AkImageSourceSettings &in_info, AkUniqueID in_AuxBusID, AkRoomID in_roomID, AkGameObjectID in_gameObjectID=AK_INVALID_GAME_OBJECT)
AkVertIdx point0
Index into the vertex table passed into AkGeometryParams that describes the first vertex of the trian...
Definition: AkSpatialAudio.h:214
AkVertIdx NumVertices
Definition: AkSpatialAudio.h:491
AkVertex * Vertices
Number of vertices in Vertices.
Definition: AkSpatialAudio.h:488
bool RoomGameObj_KeepRegistered
Definition: AkSpatialAudio.h:462
AkVector Front
Definition: AkSpatialAudio.h:419
AkReal32 roomReverbAuxBusGain
Definition: AkSpatialAudio.h:162
AkVertex()
Constructor
Definition: AkSpatialAudio.h:185
AkUInt32 numReflections
Number of reflections in the pathPoint[] array. Shadow zone diffraction does not count as a reflectio...
Definition: AkSpatialAudio.h:268
Parameters passed to SetRoom
Definition: AkSpatialAudio.h:398
AkTriangle()
Constructor
Definition: AkSpatialAudio.h:199
#define AK_MAX_REFLECTION_PATH_LENGTH
AkTransform virtualPos
Virtual emitter position.
Definition: AkSpatialAudio.h:297
static const AkMemPoolId AK_INVALID_POOL_ID
Invalid pool ID
Definition: AkTypes.h:103
AKRESULT __cdecl UnregisterEmitter(AkGameObjectID in_gameObjectID)
Position and orientation of game objects.
Definition: AkTypes.h:334
AkReal32 level
Linear gain applied to image source.
Definition: AkSpatialAudio.h:277
AkVertex(AkReal32 in_X, AkReal32 in_Y, AkReal32 in_Z)
Constructor
Definition: AkSpatialAudio.h:188
static const AkGameObjectID AK_INVALID_GAME_OBJECT
Invalid game object (may also mean all game objects)
Definition: AkTypes.h:98
AkReal32 Z
Z Position
Definition: AkTypes.h:330
#define AK_DEFAULT_DIFFR_SHADOW_ATTEN
3D vector.
Definition: AkTypes.h:310
AKRESULT __cdecl RegisterListener(AkGameObjectID in_gameObjectID)
Base type for ID's used by Wwise spatial audio.
#define AK_INVALID_VERTEX
uint32_t AkUInt32
Unsigned 32-bit integer
Definition: AkTypes.h:79
AkSurfIdx NumSurfaces
Number of of AkTriangleInfo structures in in_pTriangleInfo and number of AkTriIdx's in in_infoMap.
Definition: AkSpatialAudio.h:501
AK::SpatialAudio::String name
Name given to image source, can be used to identify the image source in the AK Reflect plugin UI.
Definition: AkSpatialAudio.h:113
static const AkUInt32 kMaxNodes
Defines the maximum number of nodes that a user can retrieve information about. Longer paths will be ...
Definition: AkSpatialAudio.h:316
AkUInt32 uPoolSize
Desired memory pool size if a new pool should be created. A pool will be created if uPoolID is not se...
Definition: AkSpatialAudio.h:58
static const AkUniqueID AK_INVALID_UNIQUE_ID
Invalid unique 32-bit ID
Definition: AkTypes.h:99
AkReal32 totLength
Total path length
Definition: AkSpatialAudio.h:306
AkUInt8 useImageSources
Enable reflections from image sources that have been added via the AK::SpatialAudio::SetImageSource()...
Definition: AkSpatialAudio.h:178
AkImageSourceTexture texture
Acoustic texture that goes with this image source.
Definition: AkSpatialAudio.h:110
AkReal32 dryDiffraction
The dry diffraction amount is normalized in the range [0,1], and calculated from the maximum deviatio...
Definition: AkSpatialAudio.h:342
Parameters passed to SetGeometry
Definition: AkSpatialAudio.h:468
AKRESULT AllocCopy()
Definition: AkString.h:79
AkReal32 Y
Y coordinate
Definition: AkSpatialAudio.h:191
AkVector Extent
Definition: AkSpatialAudio.h:372
#define AK_DEFAULT_DIFFR_SHADOW_DEGREES
float AkReal32
32-bit floating point
Definition: AkTypes.h:97
AKRESULT __cdecl SetPortal(AkPortalID in_PortalID, const AkPortalParams &in_Params)
AkUInt16 AkTriIdx
AkUInt32 nodeCount
Total number of nodes in the path. Defines the number of valid entries in the nodes and angles arrays...
Definition: AkSpatialAudio.h:300
AkReal32 gain
The cumulative gain (linear) of all portals traversed.
Definition: AkSpatialAudio.h:334
static const AkUInt32 kMaxNodes
Defines the maximum number of nodes that a user can retrieve information about. Longer paths will be ...
Definition: AkSpatialAudio.h:288
AkInt32 AkMemPoolId
Memory pool ID
Definition: AkTypes.h:72
An emitter that is not in the same room as the listener will have its apparent or virtual position ca...
Definition: AkSpatialAudio.h:41
AKRESULT __cdecl RemoveGeometry(AkGeometrySetID in_SetID)
AKRESULT __cdecl QueryDiffractionPaths(AkGameObjectID in_gameObjectID, AkVector &out_listenerPos, AkVector &out_emitterPos, AkDiffractionPathInfo *out_aPaths, AkUInt32 &io_uArraySize)
AkVector imageSource
Apparent source of the reflected sound that follows this path.
Definition: AkSpatialAudio.h:254
#define AK_INVALID_SURFACE
AkImageSourceSettings & operator=(const AkImageSourceSettings &src)
Operator =
Definition: AkSpatialAudio.h:85
Set the Wwise built-in game parameter value for diffraction angle. This is a flexible approach that c...
Definition: AkSpatialAudio.h:39
AkReal32 diffractionMaxPathLength
Definition: AkSpatialAudio.h:175
AkReal32 Y
Y Position
Definition: AkTypes.h:329
Vertex for a spatial audio mesh.
Definition: AkSpatialAudio.h:182
AKRESULT __cdecl SetPortalObstructionAndOcclusion(AkPortalID in_PortalID, AkReal32 in_fObstruction, AkReal32 in_fOcclusion)
Structure for retrieving information about the indirect paths of a sound that have been calculated vi...
Definition: AkSpatialAudio.h:251
AkVector pathPoint[AK_MAX_REFLECTION_PATH_LENGTH]
Definition: AkSpatialAudio.h:258
AkVector nodePoint[kMaxNodes]
Nodes in the path; they repreent vertices within the bounds of a portal's opening.
Definition: AkSpatialAudio.h:319
AkVertIdx point1
Index into the vertex table passed into AkGeometryParams that describes the second vertex of the tria...
Definition: AkSpatialAudio.h:217
#define AK_MAX_SOUND_PROPAGATION_DEPTH