Version

menu_open
Wwise SDK 2024.1.0
AkSpatialAudio.h
Go to the documentation of this file.
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Copyright (c) 2024 Audiokinetic Inc.
25 *******************************************************************************/
26 
27 /// \file
28 /// Spatial Audio interface.
29 
30 #pragma once
31 
35 
36 /// Determines the operation used to calculate the transmission loss value for a transmission path.
37 /// A ray is cast from listener to emitter, and this operation is applied to combine the current surface with the previous.
38 /// A geometry instance can be marked as solid by using \c AkGeometryInstanceParams::IsSolid.
39 /// If a geometry instance is solid, transmission loss is applied for each pair of hit surfaces, representing an entrance and exit through the geometry.
40 /// The transmission loss from a pair of hits through a solid geometry instance will be the max of both hits.
42 {
43  AkTransmissionOperation_Add, ///< Transmission loss of each hit surface is summed until it reaches 100%.
44  AkTransmissionOperation_Multiply, ///< The inverse of transmission loss (1 - TL) is multiplied in succession, and the result inverted. With each hit surface, the effect of additional transmission loss is reduced. The total loss will approach but never reach 100% unless a surface with 100% loss is found.
45  AkTransmissionOperation_Max, ///< The highest transmission loss of all hit surfaces is used.
47 };
48 
49 /// Initialization settings of the spatial audio module.
51 {
54  , fMovementThreshold(0.25f)
63  , fMaxPathLength(1000.0f)
64  , fCPULimitPercentage(0.0f)
70 
71  {}
72 
73  AkUInt32 uMaxSoundPropagationDepth; ///< Maximum number of portals that sound can propagate through; must be less than or equal to AK_MAX_SOUND_PROPAGATION_DEPTH.
74  AkReal32 fMovementThreshold; ///< Amount that an emitter or listener has to move to trigger a validation of reflections/diffraction. Larger values can reduce the CPU load at the cost of reduced accuracy. Note that the ray tracing itself is not affected by this value. Rays are cast each time a Spatial Audio update is executed.
75  AkUInt32 uNumberOfPrimaryRays; ///< The number of primary rays used in the ray tracing engine. A larger number of rays will increase the chances of finding reflection and diffraction paths, but will result in higher CPU usage. When CPU limit is active (see \ref AkSpatialAudioInitSettings::fCPULimitPercentage), this setting represents the maximum allowed number of primary rays.
76  AkUInt32 uMaxReflectionOrder; ///< Maximum reflection order [1, 4] - the number of 'bounces' in a reflection path. A high reflection order renders more details at the expense of higher CPU usage.
77  AkUInt32 uMaxDiffractionOrder; ///< Maximum diffraction order [1, 8] - the number of 'bends' in a diffraction path. A high diffraction order accommodates more complex geometry at the expense of higher CPU usage.
78  ///< Diffraction must be enabled on the geometry to find diffraction paths (refer to \c AkGeometryParams). Set to 0 to disable diffraction on all geometry.
79  ///< This parameter limits the recursion depth of diffraction rays cast from the listener to scan the environment, and also the depth of the diffraction search to find paths between emitter and listener.
80  ///< To optimize CPU usage, set it to the maximum number of edges you expect the obstructing geometry to traverse.
81  ///< For example, if box-shaped geometry is used exclusively, and only a single box is expected between an emitter and then listener, limiting \c uMaxDiffractionOrder to 2 may be sufficient.
82  ///< A diffraction path search starts from the listener, so when the maximum diffraction order is exceeded, the remaining geometry between the end of the path and the emitter is ignored.
83  ///< In such case, where the search is terminated before reaching the emitter, the diffraction coefficient will be underestimated. It is calculated from a partial path, ignoring any remaining geometry.
84  AkUInt32 uMaxDiffractionPaths; ///< Limit the maximum number of diffraction paths computed per emitter, excluding the direct/transmission path. The acoustics engine searches for up to uMaxDiffractionPaths paths and stops searching when this limit is reached.
85  ///< Setting a low number for uMaxDiffractionPaths (1-4) uses fewer CPU resources, but is more likely to cause discontinuities in the resulting audio. This can occur, for example, when a more prominent path is discovered, displacing a less prominent one.
86  ///< Conversely, a larger number (8 or more) produces higher quality output but requires more CPU resources. The recommended range is 2-8.
87  AkUInt32 uMaxGlobalReflectionPaths; ///< [\ref spatial_audio_experimental "Experimental"] Set a global reflection path limit among all sound emitters with early reflections enabled. Potential reflection paths, discovered by raycasting, are first sorted according to a heuristic to determine which paths are the most prominent.
88  ///< Afterwards, the full reflection path calculation is performed on only the uMaxGlobalReflectionPaths, most prominent paths. Limiting the total number of reflection path calculations can significantly reduce CPU usage. Recommended range: 10-50.
89  ///< Set to 0 to disable the limit. In this case, the number of paths computed is unbounded and depends on how many are discovered by raycasting.
90  AkUInt32 uMaxEmitterRoomAuxSends; ///< The maximum number of game-defined auxiliary sends that can originate from a single emitter. An emitter can send to its own room, and to all adjacent rooms if the emitter and listener are in the same room. If a limit is set, the most prominent sends are kept, based on spread to the adjacent portal from the emitters perspective.
91  ///< Set to 1 to only allow emitters to send directly to their current room, and to the room a listener is transitioning to if inside a portal. Set to 0 to disable the limit.
92  AkUInt32 uDiffractionOnReflectionsOrder; ///< The maximum possible number of diffraction points at each end of a reflection path. Diffraction on reflection allows reflections to fade in and out smoothly as the listener or emitter moves in and out of the reflection's shadow zone.
93  ///< When greater than zero, diffraction rays are sent from the listener to search for reflections around one or more corners from the listener.
94  ///< Diffraction must be enabled on the geometry to find diffracted reflections (refer to \c AkGeometryParams). Set to 0 to disable diffraction on reflections.
95  ///< To allow reflections to propagate through portals without being cut off, set \c uDiffractionOnReflectionsOrder to 2 or greater.
96  AkReal32 fMaxDiffractionAngleDegrees; ///< The largest possible diffraction value, in degrees, beyond which paths are not computed and are inaudible. Must be greater than zero. Default value: 180 degrees.
97  ///< A large value (for example, 360 degrees) allows paths to propagate further around corners and obstacles, but takes more CPU time to compute.
98  ///< A gain is applied to each diffraction path to taper the volume of the path to zero as the diffraction angle approaches fMaxDiffractionAngleDegrees,
99  ///< and appears in the Voice Inspector as "Propagation Path Gain". This tapering gain is applied in addition to the diffraction curves, and prevents paths from popping in or out suddenly when the maximum diffraction angle is exceeded.
100  ///< In Wwise Authoring, the horizontal axis of a diffraction curve in the attenuation editor is defined over the range 0-100%, corresponding to angles 0-180 degrees.
101  ///< If fMaxDiffractionAngleDegrees is greater than 180 degrees, diffraction coefficients over 100% are clamped and the curve is evaluated at the rightmost point.
102  AkReal32 fMaxPathLength; ///< The total length of a path composed of a sequence of segments (or rays) cannot exceed the defined maximum path length. High values compute longer paths but increase the CPU cost.
103  ///< Each individual sound is also affected by its maximum attenuation distance, specified in the Authoring tool. Reflection or diffraction paths, calculated inside Spatial Audio, will never exceed a sound's maximum attenuation distance.
104  ///< Note, however, that attenuation is considered infinite if the furthest point is above the audibility threshold.
105  AkReal32 fCPULimitPercentage; ///< Defines the targeted computation time allocated for the ray tracing engine. Defined as a percentage [0, 100] of the current audio frame. The ray tracing engine dynamically adapts the number of primary rays to target the specified computation time value. In all circumstances, the computed number of primary rays cannot exceed the number of primary rays specified by AkSpatialAudioInitSettings::uNumberOfPrimaryRays.
106  ///< A value of 0 indicates no target has been set. In this case, the number of primary rays is fixed and is set by AkSpatialAudioInitSettings::uNumberOfPrimaryRays.
107  AkReal32 fSmoothingConstantMs; ///< [\ref spatial_audio_experimental "Experimental"] Enable parameter smoothing on the diffraction paths output from the Acoustics Engine. Set fSmoothingConstantMs to a value greater than 0 to define the time constant (in milliseconds) for parameter smoothing.
108  ///< The time constant of an exponential moving average is the amount of time for the smoothed response of a unit step function to reach 1 - 1/e ~= 63.2% of the original signal.
109  ///< A large value (eg. 500-1000 ms) results in less variance but introduces lag, which is a good choice when using conservative values for uNumberOfPrimaryRays (eg. 5-10), uMaxDiffractionPaths (eg. 1-3) or fMovementThreshold ( > 1m ), in order to reduce overall CPU cost.
110  ///< A small value (eg. 10-100 ms) results in greater accuracy and faster convergence of rendering parameters. Set to 0 to disable path smoothing.
111  AkUInt32 uLoadBalancingSpread; ///< Spread the computation of paths on uLoadBalancingSpread frames [1..[. When uLoadBalancingSpread is set to 1, no load balancing is done. Values greater than 1 indicate the computation of paths will be spread on this number of frames.
112  bool bEnableGeometricDiffractionAndTransmission;///< Enable computation of geometric diffraction and transmission paths for all sources that have the <b>Enable Diffraction and Transmission</b> box checked in the Positioning tab of the Wwise Property Editor.
113  ///< This flag enables sound paths around (diffraction) and through (transmission) geometry (see \c AK::SpatialAudio::SetGeometry).
114  ///< Setting \c bEnableGeometricDiffractionAndTransmission to false implies that geometry is only to be used for reflection calculation.
115  ///< Diffraction edges must be enabled on geometry for diffraction calculation (see \c AkGeometryParams).
116  ///< If \c bEnableGeometricDiffractionAndTransmission is false but a sound has <b>Enable Diffraction and Transmission</b> selected in the Positioning tab of the authoring tool, the sound will diffract through portals but will pass through geometry as if it is not there.
117  ///< One would typically disable this setting in the case that the game intends to perform its own obstruction calculation, but geometry is still passed to spatial audio for reflection calculation.
118  bool bCalcEmitterVirtualPosition; ///< An emitter that is diffracted through a portal or around geometry will have its apparent or virtual position calculated by Wwise Spatial Audio and passed on to the sound engine.
119  AkTransmissionOperation eTransmissionOperation; ///< The operation used to determine transmission loss on direct paths.
120 };
121 
122 /// Settings for individual image sources.
124 {
125  /// Constructor
127 
128  /// Constructor with parameters
129  AkImageSourceSettings(AkVector64 in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
130  : params(in_sourcePosition, in_fDistanceScalingFactor, in_fLevel)
131  , texture()
132  {
133  }
134 
135  /// Helper function to set a single acoustic texture.
136  void SetOneTexture(AkUniqueID in_texture)
137  {
138  texture.uNumTexture = 1;
139  texture.arTextureID[0] = in_texture;
140  }
141 
142  /// Image source parameters.
144 
145  /// Acoustic texture that goes with this image source.
146  /// \akwarning Note that changing acoustic textures across frames for a given image source, identified by in_srcID, may result in a discontinuity in the audio signal.
147  /// \sa SetImageSource
149 };
150 
151 /// Vertex for a spatial audio mesh.
152 struct AkVertex
153 {
154  /// Constructor
155  AkVertex() : X(0.f), Y(0.f), Z(0.f) {}
156 
157  /// Constructor
158  AkVertex(AkReal32 in_X, AkReal32 in_Y, AkReal32 in_Z) : X(in_X), Y(in_Y), Z(in_Z) {}
159 
160  AkReal32 X; ///< X coordinate
161  AkReal32 Y; ///< Y coordinate
162  AkReal32 Z; ///< Z coordinate
163 };
164 
165 /// AkExtent describes an extent with width, height and depth. halfWidth, halfHeight and halfDepth should form a vector from the centre of the volume to the positive corner.
166 /// Used in \c AkPortalParams, negative values in the extent will cause an error. For rooms, negative values can be used to opt out of room transmission.
167 struct AkExtent
168 {
169  AkExtent() {}
170 
171  AkExtent(AkReal32 in_halfWidth, AkReal32 in_halfHeight, AkReal32 in_halfDepth)
172  : halfWidth(in_halfWidth)
173  , halfHeight(in_halfHeight)
174  , halfDepth(in_halfDepth)
175  {}
176 
180 };
181 
182 /// Triangle for a spatial audio mesh.
184 {
185  /// Constructor
190  {}
191 
192  /// Constructor
193  AkTriangle(AkVertIdx in_pt0, AkVertIdx in_pt1, AkVertIdx in_pt2, AkSurfIdx in_surfaceInfo)
194  : point0(in_pt0)
195  , point1(in_pt1)
196  , point2(in_pt2)
197  , surface(in_surfaceInfo)
198  {}
199 
200  /// 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.
202 
203  /// 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.
205 
206  /// 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.
208 
209  /// Index into the surface table passed into \c AkGeometryParams that describes the surface properties of the triangle.
210  /// If this field is left as \c AK_INVALID_SURFACE, then a default-constructed \c AkAcousticSurface is used.
212 };
213 
214 /// Describes the acoustic surface properties of one or more triangles.
215 /// 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
216 /// \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.
217 /// 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.
219 {
220  /// Constructor
222  , transmissionLoss(1.0f)
223  , strName(NULL)
224  {}
225 
226  /// 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
227  /// \sa <tt>\ref AK::SoundEngine::GetIDFromString()</tt>
229 
230  /// Transmission loss value to apply when simulating sound transmission through this geometric surface.
231  /// Transmission is only simulated on a sound when the sound has <b>Enable Diffraction and Transmission</b> box
232  /// enabled in Wwise Authoring.
233  ///
234  /// If more than one surface is intersected between the emitter and the listener, the result depends on \c AkSpatialAudioInitSettings::eTransmissionOperation. The default behavior is to use the maximum of all surfaces' transmission loss values.
235  ///
236  /// Transmission loss is applied on the mix connection between the emitter and the listener for the dry path, and between the emitter and the room for the wet path.
237  /// The transmission loss value is converted to volume attenuation, low-pass and/or high-pass filtering, using the transmission loss curves defined on the sound in Wwise Authoring.
238  ///
239  /// A transmission loss value of 0 has special meaning in some contexts:
240  /// - Setting a transmission loss value of 0 effectively disables a surface for ray intersection. It is ignored for all diffraction and reflection calculations.
241  /// - When geometry is used to define the shape of a Reverb Zone, surfaces with a transmission loss of 0 define the center of the transition between the Reverb Zone and its parent Room.
242  /// Only surfaces with transmission loss of 0 define the transition region, allowing the user to have transitions around parts of the geometry (certain walls, for example), and not others.
243  /// Valid range: (0.f-1.f)
244  /// - \ref AkRoomParams
245  /// - \ref AK::SpatialAudio::SetReverbZone
247 
248  /// Name to describe this surface
249  const char* strName;
250 };
251 
252 /// 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.
254 {
255  /// Apparent source of the reflected sound that follows this path.
257 
258  /// Vertices of the indirect path.
259  /// pathPoint[0] is closest to the emitter, pathPoint[numPathPoints-1] is closest to the listener.
261 
262  /// The texture that were hit in the path.
263  /// textureIDs[0] is closest to the emitter, textureIDs[numPathPoints-1] is closest to the listener.
265 
266  /// Number of valid elements in the \c pathPoint[], \c surfaces[], and \c diffraction[] arrays.
268 
269  /// 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.
271 
272  /// Diffraction amount, normalized to the range [0,1]
274 
275  /// Linear gain applied to image source.
277 
278  /// Deprecated - always false. Occluded paths are not generated.
280 };
281 
282 /// Structure for retrieving information about paths for a given emitter.
283 /// The diffraction paths represent indirect sound paths from the emitter to the listener, whether they go through portals
284 /// (via the rooms and portals API) or are diffracted around edges (via the geometric diffraction API).
285 /// The direct path is included here and can be identified by checking \c nodeCount == 0. The direct path may have a non-zero transmission loss
286 /// if it passes through geometry or between rooms.
288 {
289  /// Defines the maximum number of nodes that a user can retrieve information about. Longer paths will be truncated.
291 
292  /// Diffraction points along the path. nodes[0] is the point closest to the listener; nodes[numNodes-1] is the point closest to the emitter.
293  /// Neither the emitter position nor the listener position are represented in this array.
295 
296  /// Emitter position. This is the source position for an emitter. In all cases, except for radial emitters, it is the same position as the game object position.
297  /// For radial emitters, it is the calculated position at the edge of the volume.
299 
300  /// Raw diffraction angles at each point, in radians.
302 
303  /// ID of the portals that the path passes through. For a given node at position i (in the nodes array), if the path diffracts on a geometric edge, then portals[i] will be an invalid portal ID (ie. portals[i].IsValid() will return false).
304  /// Otherwise, if the path diffracts through a portal at position i, then portals[i] will be the ID of that portal.
305  /// portal[0] represents the node closest to the listener; portal[numNodes-1] represents the node closest to the emitter.
307 
308  /// ID's of the rooms that the path passes through. For a given node at position i, room[i] is the room on the listener's side of the node. If node i diffracts through a portal,
309  /// then rooms[i] is on the listener's side of the portal, and rooms[i+1] is on the emitters side of the portal.
310  /// There is always one extra slot for a room so that the emitters room is always returned in slot room[numNodes] (assuming the path has not been truncated).
312 
313  /// Virtual emitter position. This is the position that is passed to the sound engine to render the audio using multi-positioning, for this particular path.
315 
316  /// Total number of nodes in the path. Defines the number of valid entries in the \c nodes, \c angles, and \c portals arrays. The \c rooms array has one extra slot to fit the emitter's room.
318 
319  /// Calculated total diffraction from this path, normalized to the range [0,1]
320  /// The diffraction amount is calculated from the sum of the deviation angles from a straight line, of all angles at each nodePoint.
321  // Can be thought of as how far into the 'shadow region' the sound has to 'bend' to reach the listener.
322  /// This value is applied internally, by spatial audio, as the Diffraction value and built-in parameter of the emitter game object.
323  /// \sa
324  /// - \ref AkSpatialAudioInitSettings
326 
327  /// Calculated total transmission loss from this path, normalized to the range [0,1]
328  /// This field will be 0 for diffraction paths where \c nodeCount > 0. It may be non-zero for the direct path where \c nodeCount == 0.
329  /// The path's transmission loss value might be geometric transmission loss, if geometry was intersected in the path,
330  /// or room transmission loss, if no geometry was available.
331  /// The geometric transmission loss is calculated from the transmission loss values assigned to the geometry that this path transmits through.
332  /// If a path transmits through multiple geometries with different transmission loss values, the largest value is taken.
333  /// The room transmission loss is taken from the emitter and listener rooms' transmission loss values, and likewise,
334  /// if the listener's room and the emitter's room have different transmission loss values, the greater of the two is used.
335  /// This value is applied internally, by spatial audio, as the Transmission Loss value and built-in parameter of the emitter game object.
336  /// \sa
337  /// - \ref AkSpatialAudioInitSettings
338  /// - \ref AkRoomParams
339  /// - \ref AkAcousticSurface
341 
342  /// Total path length
343  /// Represents the sum of the length of the individual segments between nodes, with a correction factor applied for diffraction.
344  /// The correction factor simulates the phenomenon where by diffracted sound waves decay faster than incident sound waves and can be customized in the spatial audio init settings.
345  /// \sa
346  /// - \ref AkSpatialAudioInitSettings
348 
349  /// Obstruction value for this path
350  /// This value includes the accumulated portal obstruction for all portals along the path.
352 
353  /// Occlusion value for this path
354  /// This value includes the accumulated portal occlusion for all portals along the path.
356 
357  /// Propagation path gain.
358  /// Includes volume tapering gain to ensure that diffraction paths do not cut in or out when the maximum diffraction angle is exceeded.
360 };
361 
362 /// Parameters passed to \c SetPortal
364 {
365  /// Constructor
367  bEnabled(false)
368  {}
369 
370  /// Portal's position and orientation in the 3D world.
371  /// Position vector is the center of the opening.
372  /// 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.
373  /// 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.
375 
376  /// Portal extent. Defines the dimensions of the portal relative to its center; all components must be positive numbers.
377  /// The shape described by these extents is used to "cut out" the opening shape of room geometry. Geometry that overlaps the portal extent is effectively ignored.
378  /// The depth dimension is used to perform transitions between connected rooms by manipulating game-defined auxiliary sends.
379  /// The depth dimension is also used to place game objects into rooms while they are inside the portals.
380  /// \sa
381  /// - \ref AkExtent
383 
384  /// Whether or not the portal is active/enabled. For example, this parameter may be used to simulate open/closed doors.
385  /// Portal diffraction is simulated when at least one portal exists and is active between an emitter and the listener.
386  /// To simulate a door that opens or closes gradually, use \c AK::SpatialAudio::SetPortalObstructionAndOcclusion to apply occlusion to a portal, according to the door's opening amount.
387  /// \sa
388  /// - \ref AK::SpatialAudio::SetPortalObstructionAndOcclusion
389  bool bEnabled;
390 
391  /// 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,
392  /// 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.
393  /// - \ref AK::SpatialAudio::SetRoom
394  /// - \ref AK::SpatialAudio::RemoveRoom
395  /// - \ref AkRoomParams
397 
398  /// 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,
399  /// 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.
400  /// - \ref AK::SpatialAudio::SetRoom
401  /// - \ref AK::SpatialAudio::RemoveRoom
402  /// - \ref AkRoomParams
404 };
405 
406 /// Parameters passed to \c SetRoom
408 {
409  /// Constructor
411  , ReverbLevel(1.f)
412  , TransmissionLoss(1.f)
415  , RoomPriority(100.f)
416  {
417  // default invalid values
418  Up.X = 0.f;
419  Up.Y = 1.f;
420  Up.Z = 0.f;
421  Front.X = 0.f;
422  Front.Y = 0.f;
423  Front.Z = 1.f;
424  }
425 
426  /// Room Orientation. Up and Front must be orthonormal.
427  /// 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.
429 
430  /// Room Orientation. Up and Front must be orthonormal.
431  /// 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.
433 
434  /// The reverb aux bus that is associated with this room.
435  /// 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.
436  /// 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.
437  /// 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.
438  /// 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.
439  /// If more advanced control of reverb is desired, SetGameObjectAuxSendValues can be used to add additional sends on to a game object.
440  /// - \ref AK::SpatialAudio::SetGameObjectInRoom
441  /// - \ref AK::SoundEngine::SetGameObjectAuxSendValues
443 
444  /// The reverb control value for the send to ReverbAuxBus. Valid range: (0.f-1.f)
445  /// Can be used to implement multiple rooms that share the same aux bus, but have different reverb levels.
447 
448  /// Characteristic transmission loss value for the Room, describing the average amount of sound energy dissipated by the walls of the room.
449  ///
450  /// The Room transmission loss value is used in the following situations:
451  /// 1) If a room tone is playing on the Room Game Object, in a different room than that of the listener.
452  /// Transmission loss is only applied when the listener and the emitter are in different rooms.
453  /// It is taken as the maximum between the emitter's room's transmission loss value and the listener's room's transmission loss value.
454  /// 2) If, for both the emitter and listener's Rooms, geometry is not assigned with \c AkRoomParams::GeometryInstanceID, or the Geometry Instance that is assigned
455  /// has \c AkGeometryInstanceParams::UseForReflectionAndDiffraction set to false. In this case, room transmission loss is applied
456  /// to the direct path when the emitter and listener are in different rooms.
457  /// When geometry is available, the transmission loss value is calculated instead by intersecting a ray with the geometry between the emitter and listener.
458  /// Transmission loss on geometry overrides room transmission loss, allowing a room to have varying degrees of transmission loss (for example, some transparent walls and some opaque walls).
459  /// 3) To spatialize the output of the Room Game Object. A low transmission loss value emphasizes panning the room
460  /// towards the room's center (the center of the room bounding box) and a higher value emphasizes panning towards the room's portals.
461  ///
462  /// When room transmission is applied directly to either a room tone (situation 1) or a point source emitter (situation 2), it is applied on the mix connection between the sound and the room.
463  /// The transmission loss value is converted to volume attenuation, low-pass and/or high-pass filtering, using the transmission loss curves defined on the sound in Wwise Authoring.
464  ///
465  /// \aknote Even when relying on geometry for detailed transmission loss values (per triangle), it is still necessary to set \c AkSoundParams::TransmissionLoss to a representitive value so that
466  /// the output of the Room Game Object is properly spatialized (situation 3).
467  ///
468  /// Valid range: (0.f-1.f)
469  /// - \ref AkAcousticSurface
471 
472  /// 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,
473  /// 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
474  /// for spatial audio emitters sending to the room game object.
475  /// \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
476  /// 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
477  /// surround ambiance beds or room tones. Point source sounds should use separate game objects that are registered as spatial audio emitters.
478  /// \sa
479  /// - \ref AkRoomParams::RoomGameObj_KeepRegistered
480  /// - \ref AkRoomID
482 
483  /// If set to true, the room game object is registered on calling \c SetRoom(), and not released until the room is deleted or removed with \c RemoveRoom(). If set to false, Spatial Audio registers
484  /// the room object only when it is needed by the sound propagation system for the purposes of reverb, and unregisters the game object when all reverb tails are finished.
485  /// We recommend that you set RoomGameObj_KeepRegistered to true if you use RTPCs on the room game object, if you call \c SetScalingFactor(), or call \c PostEvent() for the purpose of ambience or room tones.
486  /// \aknote The room game object can be accessed through the ID that is passed to \c SetRoom() and the \c AkRoomID::AsGameObjectID() method. Posting an event on the room game object uses automatic room game object placement
487  /// 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
488  /// surround ambience beds or room tones. For point source sounds, use separate game objects that are registered as Spatial Audio emitters.
489  /// \sa
490  /// - \ref AkRoomParams::RoomGameObj_AuxSendLevelToSelf
491  /// - \ref AkRoomID
493 
494  /// Assign a Geometry Instance \c GeometryInstanceID, which describes the size and shape of the Room.
495  /// Assigning a Geometry Instance to a Room serves several purposes: the shape and surface properties of the geometry are used to calculate the transmission of reverb and room tones through walls,
496  /// it allows Spatial Audio to automatically determine which Game Objects are in which Room, and it allows for visualization of the room inside the Game Object 3D Viewer.
497  /// To create Room geometry, a Geometry Set must be created using AK::SpatialAudio::SetGeometry, and then a Geometry Instance must be created using AK::SpatialAudio::SetGeometryInstance.
498  /// The Room itself, however, can be created either before or after the geometry is created.
499  /// \aknote If the geometry instance is only used for room containment and not for reflection, diffraction, or transmission, then set \c AkGeometryInstanceParams::UseForReflectionAndDiffraction to false.
500  /// \sa
501  /// - \ref spatial_audio_roomsportals_apiconfigroomgeometry
502  /// - \ref AkGeometryInstanceParams
503  /// - \ref AK::SpatialAudio::SetGameObjectInRoom
505 
506  /// Associate a priority with this room. Room priority is used by the room containment system to disambiguate cases where an object is inside several rooms at the same time. In this case, the room with the higher priority is selected.
507  /// Default priority is 100.
508  /// \aknote If several rooms have the same highest room priority, the inner one is selected.
510 
511 
512 };
513 
514 /// Parameters passed to \c SetGeometry
516 {
517  /// Constructor
519 
520  /// Pointer to an array of AkTriangle structures.
521  /// This array will be copied into spatial audio memory and will not be accessed after \c SetGeometry returns.
522  /// - \ref AkTriangle
523  /// - \ref AK::SpatialAudio::SetGeometry
524  /// - \ref AK::SpatialAudio::RemoveGeometry
526 
527  /// Number of triangles in Triangles.
529 
530  /// Pointer to an array of AkVertex structures.
531  /// This array will be copied into spatial audio memory and will not be accessed after \c SetGeometry returns.
532  /// - \ref AkVertex
533  /// - \ref AK::SpatialAudio::SetGeometry
534  /// - \ref AK::SpatialAudio::RemoveGeometry
536 
537  /// Number of vertices in Vertices.
539 
540  /// Pointer to an array of AkAcousticSurface structures.
541  /// This array will be copied into spatial audio memory and will not be accessed after \c SetGeometry returns.
542  /// - \ref AkVertex
543  /// - \ref AK::SpatialAudio::SetGeometry
544  /// - \ref AK::SpatialAudio::RemoveGeometry
546 
547  /// Number of of AkTriangleInfo structures in in_pTriangleInfo and number of AkTriIdx's in in_infoMap.
549 
550  /// Switch to enable or disable geometric diffraction for this Geometry.
552 
553  /// Switch to enable or disable geometric diffraction on boundary edges for this Geometry. Boundary edges are edges that are connected to only one triangle.
555 };
556 
557 #define AK_DEFAULT_GEOMETRY_POSITION_X (0.0)
558 #define AK_DEFAULT_GEOMETRY_POSITION_Y (0.0)
559 #define AK_DEFAULT_GEOMETRY_POSITION_Z (0.0)
560 #define AK_DEFAULT_GEOMETRY_FRONT_X (0.0)
561 #define AK_DEFAULT_GEOMETRY_FRONT_Y (0.0)
562 #define AK_DEFAULT_GEOMETRY_FRONT_Z (1.0)
563 #define AK_DEFAULT_GEOMETRY_TOP_X (0.0)
564 #define AK_DEFAULT_GEOMETRY_TOP_Y (1.0)
565 #define AK_DEFAULT_GEOMETRY_TOP_Z (0.0)
566 
567 /// Parameters passed to \c SetGeometryInstance
569 {
570  /// Constructor
571  /// Creates an instance with an identity transform.
572  /// \akwarning A default-constructed AkGeometryInstanceParams assumes the default floor plane is passed to AkInitSettings::eFloorPlane.
574  : Scale({ 1, 1, 1 })
576  , BypassPortalSubtraction(false)
577  , IsSolid(false)
578  {
583  }
584 
585  /// Set the position and orientation of the geometry instance.
586  /// AkWorldTransform uses one vector to define the position of the geometry instance, and two more to define the orientation; a forward vector and an up vector.
587  /// To ensure that a geometry instance has the correct rotation with respect to the game, AkInitSettings::eFloorPlane must be initialized with the correct value.
588  /// \sa
589  /// - \ref AkInitSettings::eFloorPlane
590  /// - \ref AK::SpatialAudio::SetGeometryInstance
591  /// - \ref AK::SpatialAudio::RemoveGeometryInstance
593 
594  /// Set the 3-dimensional scaling of the geometry instance.
595  /// \sa
596  /// - \ref AK::SpatialAudio::SetGeometryInstance
597  /// - \ref AK::SpatialAudio::RemoveGeometryInstance
599 
600  /// Geometry set referenced by the instance
601  /// \sa
602  /// - \ref AK::SpatialAudio::SetGeometry
603  /// - \ref AK::SpatialAudio::RemoveGeometry
604  /// - \ref AK::SpatialAudio::SetGeometryInstance
605  /// - \ref AK::SpatialAudio::RemoveGeometryInstance
607 
608  /// When enabled, the geometry instance is indexed for ray computation and used to compute reflection, diffraction, and transmission.
609  /// If the geometry instance is used only for room containment, this flag must be set to false.
610  /// - \ref AK::SpatialAudio::SetRoom
611  /// - \ref AkRoomParams
612  ///
614 
615  /// [\ref spatial_audio_experimental "Experimental"] When set to false (default), the intersection of the geometry instance with any portal bounding box is subtracted from the geometry. In effect, an opening is created at the portal location through which sound can pass.
616  /// When set to true, portals cannot create openings in the geometry instance. Enable this to allow the geometry instance to be an obstacle to paths going into or through portal bounds.
617  /// - \ref AK::SpatialAudio::SetPortal
618  ///
620 
621  /// A solid geometry instance applies transmission loss once for each time a transmission path enters and exits its volume, using the max transmission loss between each hit surface. A non-solid geometry instance is one where each surface is infinitely thin, applying transmission loss at each surface. This option has no effect if the Transmission Operation is set to Max.
622  ///
623  bool IsSolid;
624 };
625 
626 /// Audiokinetic namespace
627 namespace AK
628 {
629  /// Audiokinetic spatial audio namespace
630  namespace SpatialAudio
631  {
632  ////////////////////////////////////////////////////////////////////////
633  /// @name Basic functions.
634  /// In order to use SpatialAudio, you need to initialize it using Init, and register the listeners that you plan on using with any of the services offered by SpatialAudio, using
635  /// RegisterListener respectively, _after_ having registered their corresponding game object to the sound engine.
636  /// \akwarning At the moment, there can be only one Spatial Audio listener registered at any given time.
637  //@{
638 
639  /// Initialize the SpatialAudio API.
641 
642  /// 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.
643  /// 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.
644  /// 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
645  /// default listeners, then it is necessary to call RegisterListener() to specify which listener to use with Spatial Audio.
647  AkGameObjectID in_gameObjectID ///< Game object ID
648  );
649 
650  /// Unregister a game object as a listener in the SpatialAudio API; clean up Spatial Audio listener data associated with in_gameObjectID.
651  /// If in_gameObjectID is the current registered listener, calling this function will clear the Spatial Audio listener and
652  /// Spatial Audio features will be disabled until another listener is registered.
653  /// This function is optional - listener are automatically unregistered when their game object is deleted in the sound engine.
654  /// \sa
655  /// - \ref AK::SpatialAudio::RegisterListener
657  AkGameObjectID in_gameObjectID ///< Game object ID
658  );
659 
660  /// Define an inner and outer radius around each sound position for a specified game object.
661  /// If the radii are set to 0, the game object is a point source. Non-zero radii create a Radial Emitter.
662  /// The radii are used in spread and distance calculations that simulates sound emitting from a spherical volume of space.
663  /// When applying attenuation curves, the distance between the listener and the inner sphere (defined by the sound position and \c in_innerRadius) is used.
664  /// The spread for each sound position is calculated as follows:
665  /// - If the listener is outside the outer radius, the spread is defined by the area that the sphere occupies in the listener field of view. Specifically, this angle is calculated as 2.0*asinf( \c in_outerRadius / distance ), where distance is the distance between the listener and the sound position.
666  /// - When the listener intersects the outer radius (the listener is exactly \c in_outerRadius units away from the sound position), the spread is exactly 50%.
667  /// - When the listener is between the inner and outer radii, the spread interpolates linearly from 50% to 100% as the listener transitions from the outer radius towards the inner radius.
668  /// - If the listener is inside the inner radius, the spread is 100%.
669  /// \aknote Transmission and diffraction calculations in Spatial Audio always use the center of the sphere (the position(s) passed into \c AK::SoundEngine::SetPosition or \c AK::SoundEngine::SetMultiplePositions) for raycasting.
670  /// To obtain accurate diffraction and transmission calculations for radial sources, where different parts of the volume may take different paths through or around geometry,
671  /// it is necessary to pass multiple sound positions into \c AK::SoundEngine::SetMultiplePositions to allow the engine to 'sample' the area at different points.
672  /// - \ref AK::SoundEngine::SetPosition
673  /// - \ref AK::SoundEngine::SetMultiplePositions
675  AkGameObjectID in_gameObjectID, ///< Game object ID
676  AkReal32 in_outerRadius, ///< Outer radius around each sound position, defining 50% spread. Must satisfy \c in_innerRadius <= \c in outerRadius.
677  AkReal32 in_innerRadius ///< Inner radius around each sound position, defining 100% spread and 0 attenuation distance. Must satisfy \c in_innerRadius <= \c in outerRadius.
678  );
679 
680  //@}
681 
682  ////////////////////////////////////////////////////////////////////////
683  /// @name Helper functions for passing game data to the Reflect plug-in.
684  /// Use this API for detailed placement of reflection image sources.
685  /// \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.
686  /// Functions of Geometry are preferred and easier to use with the Reflect plug-in. \endaknote
687  //@{
688 
689  /// Add or update an individual image source for processing via the AkReflect plug-in. Use this API for detailed placement of
690  /// 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
691  /// 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.
692  /// 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.
693  /// The image source applies all game objects that have a reflections aux send defined in the authoring tool, or only to a specific game object if \c in_gameObjectID is used.
694  /// \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.
695  /// 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.
696  /// \aknote It is possible for the AkReflect plugin to process reflections from both \c SetImageSource and the geometric reflections API on the same aux bus and game object, but be aware that image source ID collisions are possible.
697  /// The image source IDs used by the geometric reflections API are generated from hashed data that uniquely identifies the reflecting surfaces. If a collision occurs, one of the reflections will not be heard.
698  /// While collision are rare, to ensure that it never occurs use an aux bus for \c SetImageSource that is unique from the aux bus(es) defined in the authoring tool, and from those passed to \c SetEarlyReflectionsAuxSend.
699  /// \endaknote
700  /// \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
701  /// \sa
702  /// - \ref AK::SpatialAudio::RemoveImageSource
703  /// - \ref AK::SpatialAudio::ClearImageSources
704  /// - \ref AK::SpatialAudio::SetGameObjectInRoom
705  /// - \ref AK::SpatialAudio::SetEarlyReflectionsAuxSend
707  AkImageSourceID in_srcID, ///< The ID of the image source being added.
708  const AkImageSourceSettings& in_info, ///< Image source information.
709  const char* in_name, ///< Name given to image source, can be used to identify the image source in the AK Reflect plugin UI.
710  AkUniqueID in_AuxBusID = AK_INVALID_AUX_ID, ///< Aux bus that has the AkReflect plug in for early reflection DSP.
711  ///< Pass AK_INVALID_AUX_ID to use the reflections aux bus defined in the authoring tool.
712  AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT ///< The ID of the emitter game object to which the image source applies.
713  ///< Pass AK_INVALID_GAME_OBJECT to apply to all game objects that have a reflections aux bus assigned in the authoring tool.
714  );
715 
716  /// Remove an individual reflection image source that was previously added via \c SetImageSource.
717  /// \sa
718  /// - \ref AK::SpatialAudio::SetImageSource
719  /// - \ref AK::SpatialAudio::ClearImageSources
721  AkImageSourceID in_srcID, ///< The ID of the image source to remove.
722  AkUniqueID in_AuxBusID = AK_INVALID_AUX_ID, ///< Aux bus that was passed to SetImageSource.
723  AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT ///< Game object ID that was passed to SetImageSource.
724  );
725 
726  /// Remove all image sources matching \c in_AuxBusID and \c in_gameObjectID that were previously added via \c SetImageSource.
727  /// Both \c in_AuxBusID and \c in_gameObjectID can be treated as wild cards matching all aux buses and/or all game object, by passing \c AK_INVALID_AUX_ID and/or \c AK_INVALID_GAME_OBJECT, respectively.
728  /// \sa
729  /// - \ref AK::SpatialAudio::SetImageSource
730  /// - \ref AK::SpatialAudio::RemoveImageSource
732  AkUniqueID in_AuxBusID = AK_INVALID_AUX_ID, ///< Aux bus that was passed to SetImageSource, or AK_INVALID_AUX_ID to match all aux buses.
733  AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT ///< Game object ID that was passed to SetImageSource, or AK_INVALID_GAME_OBJECT to match all game objects.
734  );
735 
736  //@}
737 
738  ////////////////////////////////////////////////////////////////////////
739  /// @name Geometry
740  /// Geometry API for early reflection processing using Reflect.
741  //@{
742 
743  /// Add or update a set of geometry from the \c SpatialAudio module for geometric reflection and diffraction processing. A geometry set is a logical set of vertices, triangles, and acoustic surfaces,
744  /// 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.
745  /// It is necessary to create at least one geometry instance for each geometry set that is to be used for diffraction and reflection simulation.
746  /// \sa
747  /// - \ref AkGeometryParams
748  /// - \ref AK::SpatialAudio::SetGeometryInstance
749  /// - \ref AK::SpatialAudio::RemoveGeometry
751  AkGeometrySetID in_GeomSetID, ///< Unique geometry set ID, chosen by client.
752  const AkGeometryParams& in_params ///< Geometry parameters to set.
753  );
754 
755  /// Remove a set of geometry to the SpatialAudio API.
756  /// Calling \c AK::SpatialAudio::RemoveGeometry will remove all instances of the geometry from the scene.
757  /// \sa
758  /// - \ref AK::SpatialAudio::SetGeometry
760  AkGeometrySetID in_SetID ///< ID of geometry set to be removed.
761  );
762 
763  /// Add or update a geometry instance from the \c SpatialAudio module for geometric reflection and diffraction processing.
764  /// A geometry instance is a unique instance of a geometry set with a specified transform (position, rotation and scale).
765  /// It is necessary to create at least one geometry instance for each geometry set that is to be used for diffraction and reflection simulation.
766  /// The ID (\c in_GeomSetInstanceID) must be unique amongst all geometry instances, including geometry instances referencing different geometry sets. The ID is chosen by the client in a manner similar to \c AkGameObjectID's.
767  /// To update the transform of an existing geometry instance, call SetGeometryInstance again, passing the same \c AkGeometryInstanceID, with the updated transform.
768  /// \sa
769  /// - \ref AkGeometryInstanceParams
770  /// - \ref AK::SpatialAudio::RemoveGeometryInstance
772  AkGeometryInstanceID in_GeometryInstanceID, ///< Unique geometry set instance ID, chosen by client.
773  const AkGeometryInstanceParams& in_params ///< Geometry instance parameters to set.
774  );
775 
776  /// Remove a geometry instance from the SpatialAudio API.
777  /// \sa
778  /// - \ref AK::SpatialAudio::SetGeometryInstance
780  AkGeometryInstanceID in_GeometryInstanceID ///< ID of geometry set instance to be removed.
781  );
782 
783  /// 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.
784  /// This function must acquire the global sound engine lock and therefore, may block waiting for the lock.
785  /// \sa
786  /// - \ref AkReflectionPathInfo
788  AkGameObjectID in_gameObjectID, ///< The ID of the game object that the client wishes to query.
789  AkUInt32 in_positionIndex, ///< The index of the associated game object position.
790  AkVector64& out_listenerPos, ///< Returns the position of the listener game object that is associated with the game object \c in_gameObjectID.
791  AkVector64& out_emitterPos, ///< Returns the position of the emitter game object \c in_gameObjectID.
792  AkReflectionPathInfo* out_aPaths, ///< Pointer to an array of \c AkReflectionPathInfo's which will be filled after returning.
793  AkUInt32& io_uArraySize ///< The number of slots in \c out_aPaths, after returning the number of valid elements written.
794  );
795 
796  //@}
797 
798  ////////////////////////////////////////////////////////////////////////
799  /// @name Rooms and Portals
800  /// Sound Propagation API using rooms and portals.
801  //@{
802 
803  /// 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.
804  /// \akwarning 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
805  /// registration/unregistration of internal game objects for rooms that use these IDs and, therefore, must not collide.
806  /// Also, the room ID must not be in the reserved range (AkUInt64)(-32) to (AkUInt64)(-2) inclusively. You may, however, explicitly add the default room ID AK::SpatialAudio::kOutdoorRoomID (-1)
807  /// in order to customize its AkRoomParams, to provide a valid auxiliary bus, for example.\endakwarning
808  /// \sa
809  /// - \ref AkRoomID
810  /// - \ref AkRoomParams
811  /// - \ref AK::SpatialAudio::RemoveRoom
813  AkRoomID in_RoomID, ///< Unique room ID, chosen by the client.
814  const AkRoomParams& in_Params, ///< Parameter for the room.
815  const char* in_RoomName = nullptr ///< Name used to identify room (optional)
816  );
817 
818  /// Remove a room.
819  /// \sa
820  /// - \ref AkRoomID
821  /// - \ref AK::SpatialAudio::SetRoom
823  AkRoomID in_RoomID ///< Room ID that was passed to \c SetRoom.
824  );
825 
826  /// 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.
827  /// 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,
828  /// 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.
829  /// \sa
830  /// - \ref AkPortalID
831  /// - \ref AkPortalParams
832  /// - \ref AK::SpatialAudio::RemovePortal
834  AkPortalID in_PortalID, ///< Unique portal ID, chosen by the client.
835  const AkPortalParams& in_Params, ///< Parameter for the portal.
836  const char* in_PortalName = nullptr ///< Name used to identify portal (optional)
837  );
838 
839  /// Remove a portal.
840  /// \sa
841  /// - \ref AkPortalID
842  /// - \ref AK::SpatialAudio::SetPortal
844  AkPortalID in_PortalID ///< ID of portal to be removed, which was originally passed to SetPortal.
845  );
846 
847  /// Use a Room as a Reverb Zone.
848  /// AK::SpatialAudio::SetReverbZone establishes a parent-child relationship between two Rooms and allows for sound propagation between them
849  /// as if they were the same Room, without the need for a connecting Portal. Setting a Room as a Reverb Zone
850  /// is useful in situations where two or more acoustic environments are not easily modeled as closed rooms connected by portals.
851  /// Possible uses for Reverb Zones include: a covered area with no walls, a forested area within an outdoor space, or any situation
852  /// where multiple reverb effects are desired within a common space. Reverb Zones have many advantages compared to standard Game-Defined
853  /// Auxiliary Sends. They are part of the wet path, and form reverb chains with other Rooms; they are spatialized according to their 3D extent;
854  /// they are also subject to other acoustic phenomena simulated in Wwise Spatial Audio, such as diffraction and transmission.
855  /// A parent Room may have multiple Reverb Zones, but a Reverb Zone can only have a single Parent. If a Room is already assigned
856  /// to a parent Room, it will first be removed from the old parent (exactly as if AK::SpatialAudio::RemoveReverbZone were called)
857  /// before then being assigned to the new parent Room. A Room can not be its own parent.
858  /// The Reverb Zone and its parent are both Rooms, and as such, must be specified using AK::SpatialAudio::SetRoom.
859  /// If AK::SpatialAudio::SetReverbZone is called before AK::SpatialAudio::SetRoom, and either of the two rooms do not yet exist,
860  /// placeholder Rooms with default parameters are created. They should be subsequently parameteized with AK::SpatialAudio::SetRoom.
861  ///
862  /// To set which Reverb Zone a Game Object is in, use the AK::SpatialAudio::SetGameObjectInRoom API, and pass the Reverb Zone's Room ID.
863  /// In Wwise Spatial Audio, a Game Object can only ever be inside a single room, and Reverb Zones are no different in this regard.
864  /// \aknote
865  /// The automatically created 'outdoors' Room is commonly used as a parent Room for Reverb Zones, since they often model open spaces.
866  /// To attach a Reverb zone to outdoors, pass AK::SpatialAudio::kOutdoorRoomID as the \c in_ParentRoom argument. Like all Rooms, the 'outdoors' Room
867  /// can be parameterized (for example, to assign a reverb bus) by passing AK::SpatialAudio::kOutdoorRoomID to AK::SpatialAudio::SetRoom.
868  /// \sa
869  /// - \ref AkRoomID
870  /// - \ref AK::SpatialAudio::SetRoom
871  /// - \ref AK::SpatialAudio::RemoveRoom
872  /// - \ref AK::SpatialAudio::RemoveReverbZone
873  /// - \ref AK::SpatialAudio::kOutdoorRoomID
875  AkRoomID in_ReverbZone, ///< ID of the Room which will be specified as a Reverb Zone.
876  AkRoomID in_ParentRoom, ///< ID of the parent Room.
877  AkReal32 in_transitionRegionWidth ///< Width of the transition region between the Reverb Zone and its parent. The transition region is centered around the Reverb Zone geometry. It only applies where triangle transmission loss is set to 0.
878  );
879 
880  /// Remove a Reverb Zone from its parent.
881  /// It will no longer be possible for sound to propagate between the two rooms, unless they are explicitly connected with a Portal.
882  /// \sa
883  /// - \ref AK::SpatialAudio::SetReverbZone
884  /// - \ref AK::SpatialAudio::RemoveRoom
885  /// - \ref AK::SpatialAudio::RemoveReverbZone
887  AkRoomID in_ReverbZone ///< ID of the Room which has been specified as a Reverb Zone.
888  );
889 
890  /// 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.
891  /// 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
892  /// 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
893  /// audio.
894  /// \sa
895  /// - \ref AK::SpatialAudio::SetRoom
896  /// - \ref AK::SpatialAudio::RemoveRoom
898  AkGameObjectID in_gameObjectID, ///< Game object ID
899  AkRoomID in_CurrentRoomID ///< RoomID that was passed to \c AK::SpatialAudio::SetRoom
900  );
901 
902  /// Unset the room that the game object is currently located in.
903  /// When a game object has not been explicitly assigned to a room with \ref AK::SpatialAudio::SetGameObjectInRoom, the room is automatically computed.
904  /// \sa
905  /// - \ref AK::SpatialAudio::SetRoom
906  /// - \ref AK::SpatialAudio::RemoveRoom
908  AkGameObjectID in_gameObjectID ///< Game object ID
909  );
910 
911  /// Set the early reflections order for reflection calculation. The reflections order indicates the number of times sound can bounce off of a surface.
912  /// A higher number requires more CPU resources but results in denser early reflections. Set to 0 to globally disable reflections processing.
914  AkUInt32 in_uReflectionsOrder, ///< Number of reflections to calculate. Valid range [0,4]
915  bool in_bUpdatePaths ///< Set to true to clear existing higher-order paths and to force the re-computation of new paths. If false, existing paths will remain and new paths will be computed when the emitter or listener moves.
916  );
917 
918  /// Set the diffraction order for geometric path calculation. The diffraction order indicates the number of edges a sound can diffract around.
919  /// A higher number requires more CPU resources but results in paths found around more complex geometry. Set to 0 to globally disable geometric diffraction processing.
920  /// \sa
921  /// - \ref AkSpatialAudioInitSettings::uMaxDiffractionOrder
923  AkUInt32 in_uDiffractionOrder, ///< Number of diffraction edges to consider in path calculations. Valid range [0,8]
924  bool in_bUpdatePaths ///< Set to true to clear existing diffraction paths and to force the re-computation of new paths. If false, existing paths will remain and new paths will be computed when the emitter or listener moves.
925  );
926 
927  /// Set the maximum number of computed reflection paths
928  ///
930  AkUInt32 in_uMaxGlobalReflectionPaths ///< Maximum number of reflection paths. Valid range [0..[
931  );
932 
933  /// Set the maximum number of computed diffraction paths.
934  /// Pass a valid Game Object ID to to \c in_gameObjectID to affect a specific game object and override the value set in AkSpatialAudioInitSettings::uMaxDiffractionPaths.
935  /// Pass \c AK_INVALID_GAME_OBJECT to apply the same limit to all Game Objects (that have not previously been passed to SetMaxDiffractionPaths),
936  /// updating the value set for AkSpatialAudioInitSettings::uMaxDiffractionPaths.
937  ///
938  /// \sa
939  /// - \ref AkSpatialAudioInitSettings::uMaxDiffractionPaths
941  AkUInt32 in_uMaxDiffractionPaths, ///< Maximum number of reflection paths. Valid range [0..32]
942  AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT ///< Game Object ID. Pass AK_INVALID_GAME_OBJECT to affect all Game Objects, effectivly updating AkSpatialAudioInitSettings::uMaxDiffractionPaths. Pass a valid Game Object ID to override the init setting for a specific Game Object.
943  );
944 
945  /// Set the maximum number of game-defined auxiliary sends that can originate from a single emitter.
946  /// Set to 1 to only allow emitters to send directly to their current room. Set to 0 to disable the limit.
947  /// \sa
948  /// - \ref AkSpatialAudioInitSettings::uMaxEmitterRoomAuxSends
950  AkUInt32 in_uMaxEmitterRoomAuxSends ///< The maximum number of room aux send connections.
951  );
952 
953  /// Set the number of rays cast from the listener by the stochastic ray casting engine.
954  /// A higher number requires more CPU resources but provides more accurate results. Default value (35) should be good for most applications.
955  ///
957  AkUInt32 in_uNbPrimaryRays ///< Number of rays cast from the listener
958  );
959 
960  /// Set the number of frames on which the path validation phase will be spread. Value between [1..[
961  /// High values delay the validation of paths. A value of 1 indicates no spread at all.
962  ///
964  AkUInt32 in_uNbFrames ///< Number of spread frames
965  );
966 
967  /// [\ref spatial_audio_experimental "Experimental"] Enable parameter smoothing on the diffraction paths output from the Acoustics Engine, either globally or for a specific game object. Set fSmoothingConstantMs to a value greater than 0 to define the time constant (in milliseconds) for parameter smoothing.
968  /// \sa
969  /// - \ref AkSpatialAudioInitSettings::fSmoothingConstantMs
971  AkReal32 in_fSmoothingConstantMs, ///< Smoothing constant (ms)
972  AkGameObjectID in_gameObjectID = AK_INVALID_GAME_OBJECT ///< Game Object ID. Pass AK_INVALID_GAME_OBJECT to set the global smoothing constant, affecting all Spatial Audio Emitters and Rooms.
973  );
974 
975  /// Set an early reflections auxiliary bus for a particular game object.
976  /// Geometrical reflection calculation inside spatial audio is enabled for a game object if any sound playing on the game object has a valid early reflections aux bus specified in the authoring tool,
977  /// or if an aux bus is specified via \c SetEarlyReflectionsAuxSend.
978  /// The \c in_auxBusID parameter of SetEarlyReflectionsAuxSend applies to sounds playing on the game object \c in_gameObjectID which have not specified an early reflection bus in the authoring tool -
979  /// the parameter specified on individual sounds' reflection bus takes priority over the value passed in to \c SetEarlyReflectionsAuxSend.
980  /// \aknote
981  /// Users may apply this function to avoid duplicating sounds in the actor-mixer hierarchy solely for the sake of specifying a unique early reflection bus, or in any situation where the same
982  /// sound should be played on different game objects with different early reflection aux buses (the early reflection bus must be left blank in the authoring tool if the user intends to specify it through the API). \endaknote
984  AkGameObjectID in_gameObjectID, ///< Game object ID
985  AkAuxBusID in_auxBusID ///< Auxiliary bus ID. Applies only to sounds which have not specified an early reflection bus in the authoring tool. Pass \c AK_INVALID_AUX_ID to set only the send volume.
986  );
987 
988  /// Set an early reflections send volume for a particular game object.
989  /// The \c in_fSendVolume parameter is used to control the volume of the early reflections send. It is combined with the early reflections volume specified in the authoring tool, and is applied to all sounds
990  /// playing on the game object.
991  /// Setting \c in_fSendVolume to 0.f will disable all reflection processing for this game object.
993  AkGameObjectID in_gameObjectID, ///< Game object ID
994  AkReal32 in_fSendVolume ///< Send volume (linear) for auxiliary send. Set 0.f to disable reflection processing. Valid range 0.f-1.f.
995  );
996 
997  /// Set the obstruction and occlusion value for a portal that has been registered with Spatial Audio.
998  /// Portal obstruction simulates objects that block the direct sound path between the portal and the listener, but
999  /// allows indirect sound to pass around the obstacle. For example, use portal obstruction
1000  /// when a piece of furniture blocks the line of sight of the portal opening.
1001  /// Portal obstruction is applied to the connection between the emitter and the listener, and only affects the dry signal path.
1002  /// Portal occlusion simulates a complete blockage of both the direct and indirect sound through a portal. For example, use portal occlusion for
1003  /// opening or closing a door or window.
1004  /// Portal occlusion is applied to the connection between the emitter and the first room in the chain, as well as the connection between the emitter and listener.
1005  /// Portal occlusion affects both the dry and wet (reverberant) signal paths.
1006  /// If you are using built-in game parameters to drive RTPCs, the obstruction and occlusion values set here
1007  /// do not affect the RTPC values. This behavior is intentional and occurs because RTPCs only provide one
1008  /// value per game object, but a single game object can have multiple paths through different Portals,
1009  /// each with different obstruction and occlusion values.
1010  /// To apply detailed obstruction to specific sound paths but not others, use \c AK::SpatialAudio::SetGameObjectToPortalObstruction and \c AK::SpatialAudio::SetPortalToPortalObstruction.
1011  /// To apply occlusion and obstruction to the direct line of sight between the emitter and listener use \c AK::SoundEngine::SetObjectObstructionAndOcclusion.
1012  /// \sa
1013  /// - \ref AK::SpatialAudio::SetGameObjectToPortalObstruction
1014  /// - \ref AK::SpatialAudio::SetPortalToPortalObstruction
1015  /// - \ref AK::SoundEngine::SetObjectObstructionAndOcclusion
1017  AkPortalID in_PortalID, ///< Portal ID.
1018  AkReal32 in_fObstruction, ///< Obstruction value. Valid range 0.f-1.f
1019  AkReal32 in_fOcclusion ///< Occlusion value. Valid range 0.f-1.f
1020  );
1021 
1022  /// Set the obstruction value of the path between a game object and a portal that has been created by Spatial Audio.
1023  /// The obstruction value is applied on one of the path segments of the sound between the emitter and the listener.
1024  /// Diffraction must be enabled on the sound for a diffraction path to be created.
1025  /// Also, there should not be any portals between the provided game object and portal ID parameters.
1026  /// The obstruction value is used to simulate objects between the portal and the game object that are obstructing the sound.
1027  /// Send an obstruction value of 0 to ensure the value is removed from the internal data structure.
1028  /// \sa
1029  /// - \ref AK::SpatialAudio::SetPortalObstructionAndOcclusion
1031  AkGameObjectID in_gameObjectID, ///< Game object ID
1032  AkPortalID in_PortalID, ///< Portal ID
1033  AkReal32 in_fObstruction ///< Obstruction value. Valid range 0.f-1.f
1034  );
1035 
1036  /// Set the obstruction value of the path between two portals that has been created by Spatial Audio.
1037  /// The obstruction value is applied on one of the path segments of the sound between the emitter and the listener.
1038  /// Diffraction must be enabled on the sound for a diffraction path to be created.
1039  /// Also, there should not be any portals between the two provided ID parameters.
1040  /// The obstruction value is used to simulate objects between the portals that are obstructing the sound.
1041  /// Send an obstruction value of 0 to ensure the value is removed from the internal data structure.
1042  /// \sa
1043  /// - \ref AK::SpatialAudio::SetPortalObstructionAndOcclusion
1045  AkPortalID in_PortalID0, ///< Portal ID
1046  AkPortalID in_PortalID1, ///< Portal ID
1047  AkReal32 in_fObstruction ///< Obstruction value. Valid range 0.f-1.f
1048  );
1049 
1050  /// Query information about the wet diffraction amount for the portal \c in_portal, returned as a normalized value \c out_wetDiffraction in the range [0,1].
1051  /// The wet diffraction is calculated from how far into the 'shadow region' the listener is from the portal. Unlike dry diffraction, the
1052  /// wet diffraction does not depend on the incident angle, but only the normal of the portal.
1053  /// This value is applied by spatial audio, to the Diffraction value and built-in game parameter of the room game object that is
1054  /// on the other side of the portal (relative to the listener).
1055  /// This function must acquire the global sound engine lock and therefore, may block waiting for the lock.
1056  /// \sa
1057  /// - \ref AkSpatialAudioInitSettings
1059  AkPortalID in_portal, ///< The ID of the game object that the client wishes to query.
1060  AkReal32& out_wetDiffraction ///< The number of slots in \c out_aPaths, after returning the number of valid elements written.
1061  );
1062 
1063  /// 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.
1064  /// Returned in \c out_aPaths, this array contains the sound paths calculated from diffraction around a geometric edge and/or diffraction through portals connecting rooms.
1065  /// No paths will be returned in any of the following conditions: (1) the emitter game object has a direct line of sight to the listener game object, (2) the emitter and listener are in the same room, and the listener is completely outside the radius of the emitter,
1066  /// or (3) The emitter and listener are in different rooms, but there are no paths found via portals between the emitter and the listener.
1067  /// A single path with zero diffraction nodes is returned when all of the following conditions are met: (1) the emitter and listener are in the same room, (2) there is no direct line of sight, and (3) either the Voice's Attenuation's curve max distance is exceeded or the accumulated diffraction coefficient exceeds 1.0.
1068  /// This function must acquire the global sound engine lock and, therefore, may block waiting for the lock.
1069  /// \sa
1070  /// - \ref AkDiffractionPathInfo
1072  AkGameObjectID in_gameObjectID, ///< The ID of the game object that the client wishes to query.
1073  AkUInt32 in_positionIndex, ///< The index of the associated game object position.
1074  AkVector64& out_listenerPos, ///< Returns the position of the listener game object that is associated with the game object \c in_gameObjectID.
1075  AkVector64& out_emitterPos, ///< Returns the position of the emitter game object \c in_gameObjectID.
1076  AkDiffractionPathInfo* out_aPaths, ///< Pointer to an array of \c AkDiffractionPathInfo's which will be filled on return.
1077  AkUInt32& io_uArraySize ///< The number of slots in \c out_aPaths, after returning the number of valid elements written.
1078  );
1079 
1080  /// Set the operation used to calculate transmission loss on a direct path between emitter and listener.
1081  ///
1083  AkTransmissionOperation in_eOperation ///< The operation to be used on all transmission paths.
1084  );
1085 
1086  /// Reset the stochastic engine state by re-initializing the random seeds.
1087  ///
1089 
1090  //@}
1091  }
1092 };
AkGeometrySetID GeometryInstanceID
bool RoomGameObj_KeepRegistered
AKSOUNDENGINE_API AKRESULT QueryWetDiffraction(AkPortalID in_portal, AkReal32 &out_wetDiffraction)
AkUInt16 AkTriIdx
AKSOUNDENGINE_API AKRESULT UnregisterListener(AkGameObjectID in_gameObjectID)
Triangle for a spatial audio mesh.
AkUInt32 numPathPoints
Number of valid elements in the pathPoint[], surfaces[], and diffraction[] arrays.
AkVertex(AkReal32 in_X, AkReal32 in_Y, AkReal32 in_Z)
Constructor.
AkUInt32 textureIDs[AK_MAX_REFLECTION_PATH_LENGTH]
AkImageSourceParams params
Image source parameters.
Parameters passed to SetPortal.
@ AkTransmissionOperation_Max
The highest transmission loss of all hit surfaces is used.
Definition of data structures for AkAudioObject.
AkReal32 TransmissionLoss
AKSOUNDENGINE_API AKRESULT RemovePortal(AkPortalID in_PortalID)
AkVector Front
AkTriIdx NumTriangles
Number of triangles in Triangles.
void Set(const AkVector64 &in_position, const AkVector &in_orientationFront, const AkVector &in_orientationTop)
Set position and orientation. Orientation front and top should be orthogonal and normalized.
Definition: AkTypes.h:458
AkReal32 transmissionLoss
AkTransmissionOperation eTransmissionOperation
The operation used to determine transmission loss on direct paths.
AkVertIdx point2
Index into the vertex table passed into AkGeometryParams that describes the third vertex of the trian...
AkReal32 RoomGameObj_AuxSendLevelToSelf
AKSOUNDENGINE_API AKRESULT SetGameObjectInRoom(AkGameObjectID in_gameObjectID, AkRoomID in_CurrentRoomID)
AkAcousticSurface()
Constructor.
AKSOUNDENGINE_API AKRESULT SetMaxEmitterRoomAuxSends(AkUInt32 in_uMaxEmitterRoomAuxSends)
AkTriangle(AkVertIdx in_pt0, AkVertIdx in_pt1, AkVertIdx in_pt2, AkSurfIdx in_surfaceInfo)
Constructor.
AkReal32 Z
Z coordinate.
AkReal32 halfDepth
AKSOUNDENGINE_API AKRESULT Init(const AkSpatialAudioInitSettings &in_initSettings)
Initialize the SpatialAudio API.
#define AK_DEFAULT_GEOMETRY_POSITION_Z
AkPortalParams()
Constructor.
AKSOUNDENGINE_API AKRESULT SetReverbZone(AkRoomID in_ReverbZone, AkRoomID in_ParentRoom, AkReal32 in_transitionRegionWidth)
#define AK_DEFAULT_GEOMETRY_FRONT_Y
AKSOUNDENGINE_API AKRESULT SetMaxDiffractionPaths(AkUInt32 in_uMaxDiffractionPaths, AkGameObjectID in_gameObjectID=AK_INVALID_GAME_OBJECT)
AKSOUNDENGINE_API AKRESULT SetTransmissionOperation(AkTransmissionOperation in_eOperation)
AkAuxBusID ReverbAuxBus
#define AK_INVALID_VERTEX
AkRoomID FrontRoom
AkUInt32 uLoadBalancingSpread
Spread the computation of paths on uLoadBalancingSpread frames [1..[. When uLoadBalancingSpread is se...
AKSOUNDENGINE_API AKRESULT QueryDiffractionPaths(AkGameObjectID in_gameObjectID, AkUInt32 in_positionIndex, AkVector64 &out_listenerPos, AkVector64 &out_emitterPos, AkDiffractionPathInfo *out_aPaths, AkUInt32 &io_uArraySize)
AkRoomParams()
Constructor.
AkUInt32 nodeCount
Total number of nodes in the path. Defines the number of valid entries in the nodes,...
AkUInt64 AkGameObjectID
Game object ID.
Definition: AkTypes.h:60
AKSOUNDENGINE_API AKRESULT SetSmoothingConstant(AkReal32 in_fSmoothingConstantMs, AkGameObjectID in_gameObjectID=AK_INVALID_GAME_OBJECT)
#define AK_EXTERNAPIFUNC(_type, _name)
AKSOUNDENGINE_API AKRESULT SetEarlyReflectionsAuxSend(AkGameObjectID in_gameObjectID, AkAuxBusID in_auxBusID)
AkUInt32 uNumTexture
Number of valid textures in the texture array.
AKRESULT
Standard function call result.
Definition: AkTypes.h:134
const char * strName
Name to describe this surface.
AkVector64 nodes[kMaxNodes]
AkWorldTransform Transform
AkUInt32 AkImageSourceID
Image Source ID.
Definition: AkTypes.h:84
AkVector64 pathPoint[AK_MAX_REFLECTION_PATH_LENGTH]
#define AK_DEFAULT_GEOMETRY_FRONT_X
AkAcousticSurface * Surfaces
AkReal32 X
X coordinate.
AKSOUNDENGINE_API AKRESULT QueryReflectionPaths(AkGameObjectID in_gameObjectID, AkUInt32 in_positionIndex, AkVector64 &out_listenerPos, AkVector64 &out_emitterPos, AkReflectionPathInfo *out_aPaths, AkUInt32 &io_uArraySize)
uint8_t AkUInt8
Unsigned 8-bit integer.
AkVertIdx NumVertices
Number of vertices in Vertices.
AKSOUNDENGINE_API AKRESULT RemoveGeometryInstance(AkGeometryInstanceID in_GeometryInstanceID)
#define NULL
Definition: AkTypes.h:46
AkReal32 ReverbLevel
float AkReal32
32-bit floating point
AkUInt16 AkSurfIdx
AkReal32 halfHeight
Position and orientation of game objects in the world (i.e. supports 64-bit-precision position)
Definition: AkTypes.h:429
AKSOUNDENGINE_API AKRESULT SetImageSource(AkImageSourceID in_srcID, const AkImageSourceSettings &in_info, const char *in_name, AkUniqueID in_AuxBusID=AK_INVALID_AUX_ID, AkGameObjectID in_gameObjectID=AK_INVALID_GAME_OBJECT)
AKSOUNDENGINE_API AKRESULT SetGeometry(AkGeometrySetID in_GeomSetID, const AkGeometryParams &in_params)
Structure for retrieving information about the indirect paths of a sound that have been calculated vi...
AkSurfIdx surface
AKSOUNDENGINE_API AKRESULT SetPortalToPortalObstruction(AkPortalID in_PortalID0, AkPortalID in_PortalID1, AkReal32 in_fObstruction)
AKSOUNDENGINE_API AKRESULT RemoveReverbZone(AkRoomID in_ReverbZone)
AKSOUNDENGINE_API AKRESULT SetMaxGlobalReflectionPaths(AkUInt32 in_uMaxGlobalReflectionPaths)
bool isOccluded
Deprecated - always false. Occluded paths are not generated.
AKSOUNDENGINE_API AKRESULT SetDiffractionOrder(AkUInt32 in_uDiffractionOrder, bool in_bUpdatePaths)
AkReal32 Y
Y Position.
Definition: AkTypes.h:423
bool bCalcEmitterVirtualPosition
An emitter that is diffracted through a portal or around geometry will have its apparent or virtual p...
AkUInt32 AkUniqueID
Unique 32-bit ID.
Definition: AkTypes.h:52
void SetOneTexture(AkUniqueID in_texture)
Helper function to set a single acoustic texture.
AkReal32 angles[kMaxNodes]
Raw diffraction angles at each point, in radians.
AkReal32 RoomPriority
#define AK_DEFAULT_GEOMETRY_TOP_Z
AkReal32 X
X Position.
Definition: AkTypes.h:422
AkReal32 Y
Y coordinate.
AKSOUNDENGINE_API AKRESULT ClearImageSources(AkUniqueID in_AuxBusID=AK_INVALID_AUX_ID, AkGameObjectID in_gameObjectID=AK_INVALID_GAME_OBJECT)
AKSOUNDENGINE_API AKRESULT SetLoadBalancingSpread(AkUInt32 in_uNbFrames)
AkVector64 imageSource
Apparent source of the reflected sound that follows this path.
AKSOUNDENGINE_API AKRESULT SetGeometryInstance(AkGeometryInstanceID in_GeometryInstanceID, const AkGeometryInstanceParams &in_params)
@ AkTransmissionOperation_Multiply
The inverse of transmission loss (1 - TL) is multiplied in succession, and the result inverted....
AkPortalID portals[kMaxNodes]
#define AK_DEFAULT_GEOMETRY_POSITION_X
AkTriangle * Triangles
AkUInt32 uNumberOfPrimaryRays
The number of primary rays used in the ray tracing engine. A larger number of rays will increase the ...
AkReal32 Z
Z Position.
Definition: AkTypes.h:424
AkUInt32 uMaxReflectionOrder
Maximum reflection order [1, 4] - the number of 'bounces' in a reflection path. A high reflection ord...
#define AK_DEFAULT_GEOMETRY_TOP_X
AKSOUNDENGINE_API AKRESULT RemoveImageSource(AkImageSourceID in_srcID, AkUniqueID in_AuxBusID=AK_INVALID_AUX_ID, AkGameObjectID in_gameObjectID=AK_INVALID_GAME_OBJECT)
AkTriangle()
Constructor.
Initialization settings of the spatial audio module.
Vertex for a spatial audio mesh.
AKSOUNDENGINE_API AKRESULT UnsetGameObjectInRoom(AkGameObjectID in_gameObjectID)
AkReal32 diffraction[AK_MAX_REFLECTION_PATH_LENGTH]
Diffraction amount, normalized to the range [0,1].
AkTransmissionOperation
#define AK_MAX_REFLECTION_PATH_LENGTH
AKSOUNDENGINE_API AKRESULT RemoveRoom(AkRoomID in_RoomID)
AkVertex()
Constructor.
AKSOUNDENGINE_API AKRESULT SetReflectionsOrder(AkUInt32 in_uReflectionsOrder, bool in_bUpdatePaths)
AkVertIdx point0
Index into the vertex table passed into AkGeometryParams that describes the first vertex of the trian...
Base type for ID's used by Wwise spatial audio.
Settings for individual image sources.
AkUInt32 numReflections
Number of reflections in the pathPoint[] array. Shadow zone diffraction does not count as a reflectio...
static const AkUniqueID AK_INVALID_UNIQUE_ID
Invalid unique 32-bit ID.
Definition: AkTypes.h:97
AKSOUNDENGINE_API AKRESULT SetPortal(AkPortalID in_PortalID, const AkPortalParams &in_Params, const char *in_PortalName=nullptr)
AKSOUNDENGINE_API AKRESULT ResetStochasticEngine()
bool EnableDiffraction
Switch to enable or disable geometric diffraction for this Geometry.
Parameters passed to SetGeometryInstance.
AkSurfIdx NumSurfaces
Number of of AkTriangleInfo structures in in_pTriangleInfo and number of AkTriIdx's in in_infoMap.
AkReal32 level
Linear gain applied to image source.
AkWorldTransform virtualPos
Virtual emitter position. This is the position that is passed to the sound engine to render the audio...
#define AK_DEFAULT_GEOMETRY_TOP_Y
static const AkUInt32 kMaxNodes
Defines the maximum number of nodes that a user can retrieve information about. Longer paths will be ...
AkImageSourceSettings()
Constructor.
#define AK_DEFAULT_GEOMETRY_POSITION_Y
AKSOUNDENGINE_API AKRESULT SetGameObjectToPortalObstruction(AkGameObjectID in_gameObjectID, AkPortalID in_PortalID, AkReal32 in_fObstruction)
@ AkTransmissionOperation_Default
AkReal32 fMovementThreshold
Amount that an emitter or listener has to move to trigger a validation of reflections/diffraction....
AkRoomID rooms[kMaxNodes+1]
AkReal32 halfWidth
bool EnableDiffractionOnBoundaryEdges
Switch to enable or disable geometric diffraction on boundary edges for this Geometry....
static const AkGameObjectID AK_INVALID_GAME_OBJECT
Invalid game object (may also mean all game objects)
Definition: AkTypes.h:96
3D 64-bit vector. Intended as storage for world positions of sounds and objects, benefiting from 64-b...
Definition: AkTypes.h:334
AkExtent(AkReal32 in_halfWidth, AkReal32 in_halfHeight, AkReal32 in_halfDepth)
AkImageSourceTexture texture
AkImageSourceSettings(AkVector64 in_sourcePosition, AkReal32 in_fDistanceScalingFactor, AkReal32 in_fLevel)
Constructor with parameters.
uint32_t AkUInt32
Unsigned 32-bit integer.
#define AK_DEFAULT_GEOMETRY_FRONT_Z
#define AK_INVALID_SURFACE
static const AkAuxBusID AK_INVALID_AUX_ID
Invalid auxiliary bus ID (or no Aux bus ID)
Definition: AkTypes.h:103
AkVertex * Vertices
AkUInt32 AkAuxBusID
Auxilliary bus ID.
Definition: AkTypes.h:65
AkUInt32 uMaxSoundPropagationDepth
Maximum number of portals that sound can propagate through; must be less than or equal to AK_MAX_SOUN...
AkUInt16 AkVertIdx
3D vector for some operations in 3D space. Typically intended only for localized calculations due to ...
Definition: AkTypes.h:369
AkGeometrySetID GeometrySetID
AKSOUNDENGINE_API AKRESULT SetEarlyReflectionsVolume(AkGameObjectID in_gameObjectID, AkReal32 in_fSendVolume)
AkGeometryParams()
Constructor.
AKSOUNDENGINE_API AKRESULT SetPortalObstructionAndOcclusion(AkPortalID in_PortalID, AkReal32 in_fObstruction, AkReal32 in_fOcclusion)
@ AkTransmissionOperation_Add
Transmission loss of each hit surface is summed until it reaches 100%.
AKSOUNDENGINE_API AKRESULT RemoveGeometry(AkGeometrySetID in_SetID)
AkUniqueID arTextureID[AK_MAX_NUM_TEXTURE]
Unique IDs of the Acoustics Texture ShareSets used to filter this image source.
Parameters passed to SetRoom.
#define AK_MAX_SOUND_PROPAGATION_DEPTH
Parameters passed to SetGeometry.
AkVertIdx point1
Index into the vertex table passed into AkGeometryParams that describes the second vertex of the tria...
AkWorldTransform PositionAndOrientation
AKSOUNDENGINE_API AKRESULT RegisterListener(AkGameObjectID in_gameObjectID)
AKSOUNDENGINE_API AKRESULT SetRoom(AkRoomID in_RoomID, const AkRoomParams &in_Params, const char *in_RoomName=nullptr)
AKSOUNDENGINE_API AKRESULT SetGameObjectRadius(AkGameObjectID in_gameObjectID, AkReal32 in_outerRadius, AkReal32 in_innerRadius)
AKSOUNDENGINE_API AKRESULT SetNumberOfPrimaryRays(AkUInt32 in_uNbPrimaryRays)

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

Besoin d'aide ?

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

Visitez notre page d'Aide

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

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

Partir du bon pied avec Wwise