Version

menu_open
Wwise SDK 2024.1.0
AkCommonDefs.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 // AkCommonDefs.h
28 
29 /// \file
30 /// AudioLib common defines, enums, and structs.
31 
32 
33 #ifndef _AK_COMMON_DEFS_H_
34 #define _AK_COMMON_DEFS_H_
35 
39 
40 //-----------------------------------------------------------------------------
41 // AUDIO DATA FORMAT
42 //-----------------------------------------------------------------------------
43 
44 // Audio data format.
45 // ------------------------------------------------
46 
47 const AkDataTypeID AK_INT = 0; ///< Integer data type (uchar, short, and so on)
48 const AkDataTypeID AK_FLOAT = 1; ///< Float data type
49 
50 const AkDataInterleaveID AK_INTERLEAVED = 0; ///< Interleaved data
51 const AkDataInterleaveID AK_NONINTERLEAVED = 1; ///< Non-interleaved data
52 
53 // Native format currently the same on all supported platforms, may become platform specific in the future
54 const AkUInt32 AK_LE_NATIVE_BITSPERSAMPLE = 32; ///< Native number of bits per sample.
55 const AkUInt32 AK_LE_NATIVE_SAMPLETYPE = AK_FLOAT; ///< Native data type.
56 const AkUInt32 AK_LE_NATIVE_INTERLEAVE = AK_NONINTERLEAVED; ///< Native interleaved setting.
57 
58 /// Defines the parameters of an audio buffer format.
60 {
61  AkUInt32 uSampleRate; ///< Number of samples per second
62 
63  AkChannelConfig channelConfig; ///< Channel configuration.
64 
65  AkUInt32 uBitsPerSample :6; ///< Number of bits per sample.
66  AkUInt32 uBlockAlign :10;///< Number of bytes per sample frame. (For example a 5.1 PCM 16bit should have a uBlockAlign equal to 6(5.1 channels)*2(16 bits per sample) = 12.
67  AkUInt32 uTypeID :2; ///< Data type ID (AkDataTypeID).
68  AkUInt32 uInterleaveID :1; ///< Interleave ID (AkDataInterleaveID).
69 
70  /// Get the number of channels.
71  /// \return The number of channels
73  {
75  }
76 
77  /// Query if LFE channel is present.
78  /// \return True when LFE channel is present
79  AkForceInline bool HasLFE() const
80  {
81  return channelConfig.HasLFE();
82  }
83 
84  /// Query if center channel is present.
85  /// Note that mono configurations have one channel which is arbitrary set to AK_SPEAKER_FRONT_CENTER,
86  /// so HasCenter() returns true for mono signals.
87  /// \return True when center channel is present and configuration has more than 2 channels.
88  AkForceInline bool HasCenter() const
89  {
90  return channelConfig.HasCenter();
91  }
92 
93  /// Get the number of bits per sample.
94  /// \return The number of bits per sample
96  {
97  return uBitsPerSample;
98  }
99 
100  /// Get the block alignment.
101  /// \return The block alignment
103  {
104  return uBlockAlign;
105  }
106 
107  /// Get the data sample format (Float or Integer).
108  /// \return The data sample format
110  {
111  return uTypeID;
112  }
113 
114  /// Get the interleaved type.
115  /// \return The interleaved type
117  {
118  return uInterleaveID;
119  }
120 
121  /// Set all parameters of the audio format structure.
122  /// Channels are specified by channel mask (standard configs).
123  void SetAll(
124  AkUInt32 in_uSampleRate, ///< Number of samples per second
125  AkChannelConfig in_channelConfig, ///< Channel configuration
126  AkUInt32 in_uBitsPerSample, ///< Number of bits per sample
127  AkUInt32 in_uBlockAlign, ///< Number of bytes per sample frame. (For example a 5.1 PCM 16bit should have a uBlockAlign equal to 6(5.1 channels)*2(16 bits per sample) = 12.
128  AkUInt32 in_uTypeID, ///< Data sample format (Float or Integer)
129  AkUInt32 in_uInterleaveID ///< Interleaved type
130  )
131  {
132  uSampleRate = in_uSampleRate;
133  channelConfig = in_channelConfig;
134  uBitsPerSample = in_uBitsPerSample;
135  uBlockAlign = in_uBlockAlign;
136  uTypeID = in_uTypeID;
137  uInterleaveID = in_uInterleaveID;
138  }
139 
140  AkForceInline bool operator==(const AkAudioFormat & in_other) const
141  {
142  return uSampleRate == in_other.uSampleRate
143  && channelConfig == in_other.channelConfig
144  && uBitsPerSample == in_other.uBitsPerSample
145  && uBlockAlign == in_other.uBlockAlign
146  && uTypeID == in_other.uTypeID
147  && uInterleaveID == in_other.uInterleaveID;
148  }
149 
150  AkForceInline bool operator!=(const AkAudioFormat & in_other) const
151  {
152  return uSampleRate != in_other.uSampleRate
153  || channelConfig != in_other.channelConfig
154  || uBitsPerSample != in_other.uBitsPerSample
155  || uBlockAlign != in_other.uBlockAlign
156  || uTypeID != in_other.uTypeID
157  || uInterleaveID != in_other.uInterleaveID;
158  }
159 };
160 
161 typedef AkUInt8(*AkChannelMappingFunc)(const AkChannelConfig &config, AkUInt8 idx);
162 
163 #define AK_MAKE_CHANNELCONFIGOVERRIDE(_config,_order) ((AkInt64)_config.Serialize()|((AkInt64)_order<<32))
164 #define AK_GET_CHANNELCONFIGOVERRIDE_CONFIG(_over) (_over&UINT_MAX)
165 #define AK_GET_CHANNELCONFIGOVERRIDE_ORDERING(_over) ((AK::AkChannelOrdering)(_over>>32))
166 
167 // Build a 32 bit class identifier based on the Plug-in type,
168 // CompanyID and PluginID.
169 //
170 // Parameters:
171 // - in_pluginType: A value from enum AkPluginType (4 bits)
172 // - in_companyID: CompanyID as defined in the Plug-in's XML file (12 bits)
173 // * 0-63: Reserved for Audiokinetic
174 // * 64-255: Reserved for clients' in-house Plug-ins
175 // * 256-4095: Assigned by Audiokinetic to third-party plug-in developers
176 // - in_pluginID: PluginID as defined in the Plug-in's XML file (16 bits)
177 // * 0-32767: Set freely by the Plug-in developer
178 #define AKMAKECLASSID( in_pluginType, in_companyID, in_pluginID ) \
179  ( (in_pluginType) + ( (in_companyID) << 4 ) + ( (in_pluginID) << ( 4 + 12 ) ) )
180 
181 #define AKGETPLUGINTYPEFROMCLASSID( in_classID ) ( (in_classID) & AkPluginTypeMask )
182 #define AKGETCOMPANYIDFROMCLASSID( in_classID ) ( ( (in_classID) & 0x0000FFF0 ) >> 4 )
183 #define AKGETPLUGINIDFROMCLASSID( in_classID ) ( ( (in_classID) & 0xFFFF0000 ) >> ( 4 + 12 ) )
184 
185 #define CODECID_FROM_PLUGINID AKGETPLUGINIDFROMCLASSID
186 
187 
188 namespace AK
189 {
190  /// Struct containing metering information about a buffer. Depending on when this struct is generated, you may get metering data computed in the previous frame only.
191  struct AkMetering
192  {
193  /// Peak of each channel in this frame.
194  /// Vector of linear peak levels, corresponding to each channel. NULL if AK_EnableBusMeter_Peak is not set (see IAkMixerPluginContext::SetMeteringFlags() or AK::SoundEngine::RegisterBusMeteringCallback()).
196 
197  /// True peak of each channel (as defined by ITU-R BS.1770) in this frame.
198  /// Vector of linear true peak levels, corresponding to each channel. NULL if AK_EnableBusMeter_TruePeak is not set (see IAkMixerPluginContext::SetMeteringFlags() or AK::SoundEngine::RegisterBusMeteringCallback()).
200 
201  /// RMS value of each channel in this frame.
202  /// Vector of linear rms levels, corresponding to each channel. NULL if AK_EnableBusMeter_RMS is not set (see IAkMixerPluginContext::SetMeteringFlags() or AK::SoundEngine::RegisterBusMeteringCallback()).
204 
205  /// Mean k-weighted power value in this frame, used to compute loudness (as defined by ITU-R BS.1770).
206  /// Total linear k-weighted power of all channels. 0 if AK_EnableBusMeter_KPower is not set (see IAkMixerPluginContext::SetMeteringFlags() or AK::SoundEngine::RegisterBusMeteringCallback()).
208  };
209 
210  static inline bool IsBankCodecID(AkUInt32 in_codecID)
211  {
212  return in_codecID == AKCODECID_BANK ||
213  in_codecID == AKCODECID_BANK_EVENT ||
214  in_codecID == AKCODECID_BANK_BUS;
215  }
216 }
217 
218 // 3D Audio Object.
219 // ------------------------------------------------
220 
221 /// Default listener transform.
222 #define AK_DEFAULT_LISTENER_POSITION_X (0.0f) // at coordinate system's origin
223 #define AK_DEFAULT_LISTENER_POSITION_Y (0.0f)
224 #define AK_DEFAULT_LISTENER_POSITION_Z (0.0f)
225 #define AK_DEFAULT_LISTENER_FRONT_X (0.0f) // looking toward Z,
226 #define AK_DEFAULT_LISTENER_FRONT_Y (0.0f)
227 #define AK_DEFAULT_LISTENER_FRONT_Z (1.0f)
228 #define AK_DEFAULT_TOP_X (0.0f) // top towards Y
229 #define AK_DEFAULT_TOP_Y (1.0f)
230 #define AK_DEFAULT_TOP_Z (0.0f)
231 
232 
233 /// 3D data needed for 3D spatialization.
234 /// Undergoes transformations based on emitter-listener placement.
235 struct Ak3dData
236 {
238  : spread(1.f)
239  , focus(1.f)
240  , uEmitterChannelMask(0xffffffff)
241  {
243  }
244 
245  AkTransform xform; ///< Object position / orientation.
246  AkReal32 spread; ///< Spread [0,1]
247  AkReal32 focus; ///< Focus [0,1]
248  AkChannelMask uEmitterChannelMask; ///< Emitter channel mask. With 3D spatialization, zeroed channels should be dropped.
249 };
250 
251 /// Positioning data inherited from sound structures and mix busses.
253 {
255  : center(1.f)
256  , panLR(0.f)
257  , panBF(0.f)
258  , panDU(0.f)
259  , panSpatMix(1.f)
262  , enableHeightSpread(true)
263  {}
264 
265  AkReal32 center; ///< Center percentage [0,1]
266  AkReal32 panLR; ///< Pan left-right [-1,1]
267  AkReal32 panBF; ///< Pan back-front [-1,1]
268  AkReal32 panDU; ///< Pan down-up [-1,1]
269  AkReal32 panSpatMix; ///< Panning vs 3D spatialization mix ([0,1], 1 being 100% spatialized).
270  Ak3DSpatializationMode spatMode; ///< 3D spatialization mode.
271  AkSpeakerPanningType panType; ///< Speaker panning type.
272  bool enableHeightSpread; ///< When true, audio objects 3D spatialized onto a planar channel configuration will be given a minimum spread value based on their elevation angle, equal to sin(elevation)**2.
273 };
274 
275 /// Positioning data of 3D audio objects.
277 {
278  Ak3dData threeD; ///< 3D data used for 3D spatialization.
279  AkBehavioralPositioningData behavioral; ///< Positioning data inherited from sound structures and mix busses.
280 };
281 
282 /// Structure containing information about system-level support for 3D audio.
283 /// "3D Audio" refers to a system's ability to position sound sources in a virtual 3D space, pan them accordingly on a range of physical speakers, and produce a binaural mix where appropriate.
284 /// We prefer "3D Audio" to "Spatial" to avoid ambiguity with spatial audio, which typically involves sound propagation and environment effects.
286 {
287  AkChannelConfig channelConfig{}; ///< Channel configuration of the main mix.
288  AkUInt32 uMaxSystemAudioObjects = 0; ///< Maximum number of System Audio Objects that can be active concurrently. A value of zero indicates the system does not support this feature.
289  AkUInt32 uAvailableSystemAudioObjects = 0; ///< How many System Audio Objects can currently be sent to the sink. This value can change at runtime depending on what is playing. Can never be higher than uMaxSystemAudioObjects.
290  bool bPassthrough = false; ///< Separate pass-through mix is supported.
291  bool bMultiChannelObjects = false; ///< Can handle multi-channel objects
292 };
293 
294 /// Enum of the possible object destinations when reaching a 3D audio-capable sink
296 {
297  eDefault = 0, // The destination will be chosen based on the audio object's metadata and channel configuration
298  eMainMix = 1, // The audio object will be mixed to the sink's main mix
299  ePassthrough = 2, // The audio object will be mixed to the sink's passthrough mix
300  eSystemAudioObject = 3 // The audio object will not be mixed; it will be sent separately to the system's 3D audio endpoint
301 };
302 
303 // Audio buffer.
304 // ------------------------------------------------
305 
306 /// Native sample type.
307 /// \remarks Sample values produced by insert effects must use this type.
308 /// \remarks Source plug-ins can produce samples of other types (specified through
309 /// according fields of AkAudioFormat, at initial handshaking), but these will be
310 /// format converted internally into the native format.
311 /// \sa
312 /// - \ref iaksourceeffect_init
313 /// - \ref iakmonadiceffect_init
314 typedef AkReal32 AkSampleType; ///< Audio sample data type (32 bit floating point)
315 
316 /// Audio buffer structure including the address of an audio buffer, the number of valid frames inside,
317 /// and the maximum number of frames the audio buffer can hold.
318 /// \sa
319 /// - \ref fx_audiobuffer_struct
321 {
322 public:
323 
324  /// Constructor.
326  {
327  Clear();
328  }
329 
330  /// Clear data pointer.
332  {
333  pData = NULL;
334  uValidFrames = 0;
335  }
336 
337  /// Clear members.
339  {
340  ClearData();
341  uMaxFrames = 0;
343  }
344 
345  /// \name Channel queries.
346  //@{
347  /// Get the number of channels.
349  {
351  }
352 
353  /// Returns true if there is an LFE channel present.
354  AkForceInline bool HasLFE() const
355  {
356  return channelConfig.HasLFE();
357  }
358 
360 
361  //@}
362 
363  /// \name Interleaved interface
364  //@{
365  /// Get address of data: to be used with interleaved buffers only.
366  /// \remarks Only source plugins can output interleaved data. This is determined at
367  /// initial handshaking.
368  /// \sa
369  /// - \ref fx_audiobuffer_struct
371  {
372  return pData;
373  }
374 
375  /// Attach interleaved data. Allocation is performed outside.
376  inline void AttachInterleavedData( void * in_pData, AkUInt16 in_uMaxFrames, AkUInt16 in_uValidFrames )
377  {
378  pData = in_pData;
379  uMaxFrames = in_uMaxFrames;
380  uValidFrames = in_uValidFrames;
382  }
383  /// Attach interleaved data with a new channel config. Allocation is performed outside.
384  inline void AttachInterleavedData( void * in_pData, AkUInt16 in_uMaxFrames, AkUInt16 in_uValidFrames, AkChannelConfig in_channelConfig )
385  {
386  pData = in_pData;
387  uMaxFrames = in_uMaxFrames;
388  uValidFrames = in_uValidFrames;
389  channelConfig = in_channelConfig;
390  }
391  //@}
392 
393  /// \name Deinterleaved interface
394  //@{
395 
396  /// Check if buffer has samples attached to it.
397  AkForceInline bool HasData() const
398  {
399  return ( NULL != pData );
400  }
401 
402  /// Convert a channel, identified by a single channel bit, to a buffer index used in GetChannel() below, for a given channel config.
403  /// Standard indexing follows channel bit order (see AkSpeakerConfig.h). Pipeline/buffer indexing is the same but the LFE is moved to the end.
405  AkChannelConfig in_channelConfig, ///< Channel configuration.
406  AkUInt32 in_uChannelIdx ///< Channel index in standard ordering to be converted to pipeline ordering.
407  )
408  {
409  if ( in_channelConfig.HasLFE() )
410  {
411  AKASSERT( in_channelConfig.eConfigType == AK_ChannelConfigType_Standard ); // in_channelConfig.HasLFE() would not have returned true otherwise.
412  AKASSERT( AK::GetNumNonZeroBits( in_channelConfig.uChannelMask ) );
413  AkUInt32 uIdxLFE = AK::GetNumNonZeroBits( ( AK_SPEAKER_LOW_FREQUENCY - 1 ) & in_channelConfig.uChannelMask );
414  if ( in_uChannelIdx == uIdxLFE )
415  return in_channelConfig.uNumChannels - 1;
416  else if ( in_uChannelIdx > uIdxLFE )
417  return in_uChannelIdx - 1;
418  }
419 
420  return in_uChannelIdx;
421  }
422 
423  /// Get the buffer of the ith channel.
424  /// Access to channel data is most optimal through this method. Use whenever the
425  /// speaker configuration is known, or when an operation must be made independently
426  /// for each channel.
427  /// \remarks When using a standard Wwise pipeline configuration, use ChannelBitToIndex() to convert channel bits to buffer indices.
428  /// \return Address of the buffer of the ith channel.
429  /// \sa
430  /// - \ref fx_audiobuffer_struct
431  /// - \ref fx_audiobuffer_struct_channels
433  AkUInt32 in_uIndex ///< Channel index [0,NumChannels()-1]
434  )
435  {
436  AKASSERT( in_uIndex < NumChannels() );
437  return (AkSampleType*)((AkUInt8*)(pData) + ( in_uIndex * sizeof(AkSampleType) * MaxFrames() ));
438  }
439 
440  /// Get the buffer of the LFE.
441  /// \return Address of the buffer of the LFE. Null if there is no LFE channel.
442  /// \sa
443  /// - \ref fx_audiobuffer_struct_channels
444  inline AkSampleType * GetLFE()
445  {
447  return GetChannel( NumChannels()-1 );
448 
449  return (AkSampleType*)0;
450  }
451 
452  /// Can be used to transform an incomplete into a complete buffer with valid data.
453  /// The invalid frames are made valid (zeroed out) for all channels and the validFrames count will be made equal to uMaxFrames.
455  {
456  AKASSERT(pData != nullptr || MaxFrames() == 0);
457  // The following members MUST be copied locally due to multi-core calls to this function.
458  const AkUInt32 uNumChannels = NumChannels();
459  const AkUInt32 uNumCurrentFrames = AkMin(uValidFrames, MaxFrames());
460  const AkUInt32 uNumZeroFrames = MaxFrames() - uNumCurrentFrames;
461  if ( uNumZeroFrames )
462  {
463  AKASSERT(pData != nullptr);
464  for ( AkUInt32 i = 0; i < uNumChannels; ++i )
465  {
466  memset( GetChannel(i) + uNumCurrentFrames, 0, uNumZeroFrames * sizeof(AkSampleType) );
467  }
469  }
470  }
471 
472  /// Attach deinterleaved data where channels are contiguous in memory. Allocation is performed outside.
473  AkForceInline void AttachContiguousDeinterleavedData( void * in_pData, AkUInt16 in_uMaxFrames, AkUInt16 in_uValidFrames, AkChannelConfig in_channelConfig )
474  {
475  AttachInterleavedData( in_pData, in_uMaxFrames, in_uValidFrames, in_channelConfig );
476  }
477  /// Detach deinterleaved data where channels are contiguous in memory. The address of the buffer is returned and fields are cleared.
479  {
480  uMaxFrames = 0;
481  uValidFrames = 0;
483  void * pDataOld = pData;
484  pData = NULL;
485  return pDataOld;
486  }
487 
489 
490  //@}
491 
492  void RelocateMedia( AkUInt8* in_pNewMedia, AkUInt8* in_pOldMedia )
493  {
494  AkUIntPtr uMemoryOffset = (AkUIntPtr)in_pNewMedia - (AkUIntPtr)in_pOldMedia;
495  pData = (void*) (((AkUIntPtr)pData) + uMemoryOffset);
496  }
497 
498  /// Access to the number of sample frames the buffer can hold.
499  /// \return Number of sample frames the buffer can hold.
501 
502 protected:
503  void * pData; ///< Start of the audio buffer.
504  AkChannelConfig channelConfig; ///< Channel config.
505 
506 public:
507  AKRESULT eState; ///< Execution status
508 
509 protected:
510  AkUInt16 uMaxFrames; ///< Number of sample frames the buffer can hold. Access through AkAudioBuffer::MaxFrames().
511 
512 public:
513  AkUInt16 uValidFrames; ///< Number of valid sample frames in the audio buffer
514 };
515 
516 #endif // _AK_COMMON_DEFS_H_
AkForceInline bool HasLFE() const
Returns true if there is an LFE channel present.
Definition: AkCommonDefs.h:354
bool enableHeightSpread
When true, audio objects 3D spatialized onto a planar channel configuration will be given a minimum s...
Definition: AkCommonDefs.h:272
#define AkMin(x1, x2)
AkUInt8 AkDataInterleaveID
Data interleaved state ID.
Definition: AkTypes.h:70
@ AK_DirectSpeakerAssignment
No panning: route to matching channels between input and output.
Definition: AkTypes.h:1124
AkUInt32 uAvailableSystemAudioObjects
How many System Audio Objects can currently be sent to the sink. This value can change at runtime dep...
Definition: AkCommonDefs.h:289
AkSampleType * GetChannel(AkUInt32 in_uIndex)
Definition: AkCommonDefs.h:432
#define AK_DEFAULT_TOP_Z
Definition: AkCommonDefs.h:230
uint16_t AkUInt16
Unsigned 16-bit integer.
Definition of data structures for AkAudioObject.
AkForceInline bool HasData() const
Check if buffer has samples attached to it.
Definition: AkCommonDefs.h:397
AkForceInline bool HasCenter() const
AkReal32 center
Center percentage [0,1].
Definition: AkCommonDefs.h:265
AkForceInline AkChannelConfig GetChannelConfig() const
Definition: AkCommonDefs.h:359
AkReal32 panSpatMix
Panning vs 3D spatialization mix ([0,1], 1 being 100% spatialized).
Definition: AkCommonDefs.h:269
bool bMultiChannelObjects
Can handle multi-channel objects.
Definition: AkCommonDefs.h:291
AkAudioBuffer()
Constructor.
Definition: AkCommonDefs.h:325
AkUInt32 uMaxSystemAudioObjects
Maximum number of System Audio Objects that can be active concurrently. A value of zero indicates the...
Definition: AkCommonDefs.h:288
AkUInt32 uNumChannels
Number of channels.
AkForceInline void * DetachContiguousDeinterleavedData()
Detach deinterleaved data where channels are contiguous in memory. The address of the buffer is retur...
Definition: AkCommonDefs.h:478
AkForceInline AkUInt32 NumChannels() const
Get the number of channels.
Definition: AkCommonDefs.h:348
AkForceInline void Clear()
Clear members.
Definition: AkCommonDefs.h:338
#define AK_DEFAULT_LISTENER_FRONT_Y
Definition: AkCommonDefs.h:226
AKRESULT
Standard function call result.
Definition: AkTypes.h:134
AkUInt32 uChannelMask
Channel mask (configuration).
static AkUInt32 StandardToPipelineIndex(AkChannelConfig in_channelConfig, AkUInt32 in_uChannelIdx)
Definition: AkCommonDefs.h:404
@ AK_ChannelConfigType_Standard
Channels must be identified with standard defines in AkSpeakerConfigs.
AkForceInline bool HasCenter() const
Definition: AkCommonDefs.h:88
void Set(const AkVector &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:578
AkUInt32 AkChannelMask
Channel mask (similar to WAVE_FORMAT_EXTENSIBLE). Bit values are defined in AkSpeakerConfig....
Definition: AkTypes.h:81
AkChannelConfig channelConfig
Channel configuration.
Definition: AkCommonDefs.h:63
#define AK_DEFAULT_LISTENER_POSITION_Z
Definition: AkCommonDefs.h:224
void RelocateMedia(AkUInt8 *in_pNewMedia, AkUInt8 *in_pOldMedia)
Definition: AkCommonDefs.h:492
uint8_t AkUInt8
Unsigned 8-bit integer.
AkUInt32 uBitsPerSample
Number of bits per sample.
Definition: AkCommonDefs.h:65
#define AK_DEFAULT_LISTENER_POSITION_Y
Definition: AkCommonDefs.h:223
Positioning data inherited from sound structures and mix busses.
Definition: AkCommonDefs.h:253
AkUInt32 uTypeID
Data type ID (AkDataTypeID).
Definition: AkCommonDefs.h:67
#define AK_DEFAULT_TOP_X
Definition: AkCommonDefs.h:228
AK::SpeakerVolumes::VectorPtr rms
Definition: AkCommonDefs.h:203
#define NULL
Definition: AkTypes.h:46
float AkReal32
32-bit floating point
AKRESULT eState
Execution status.
Definition: AkCommonDefs.h:507
AK::SpeakerVolumes::VectorPtr truePeak
Definition: AkCommonDefs.h:199
AkReal32 panDU
Pan down-up [-1,1].
Definition: AkCommonDefs.h:268
AkUInt16 uValidFrames
Number of valid sample frames in the audio buffer.
Definition: AkCommonDefs.h:513
uintptr_t AkUIntPtr
Integer (unsigned) type for pointers.
#define AK_DEFAULT_TOP_Y
Definition: AkCommonDefs.h:229
AkReal32 * VectorPtr
Volume vector. Access each element with the standard bracket [] operator.
void * pData
Start of the audio buffer.
Definition: AkCommonDefs.h:503
AkAudioObjectDestination
Enum of the possible object destinations when reaching a 3D audio-capable sink.
Definition: AkCommonDefs.h:296
AkChannelConfig channelConfig
Channel config.
Definition: AkCommonDefs.h:504
Ak3DSpatializationMode
3D spatialization mode.
Definition: AkTypes.h:1160
AkReal32 fMeanPowerK
Definition: AkCommonDefs.h:207
#define AK_DEFAULT_LISTENER_POSITION_X
Default listener transform.
Definition: AkCommonDefs.h:222
const AkDataTypeID AK_FLOAT
Float data type.
Definition: AkCommonDefs.h:48
AkUInt16 AkDataTypeID
Data sample type ID.
Definition: AkTypes.h:69
#define AKASSERT(Condition)
Definition: AkAssert.h:67
AkSpeakerPanningType panType
Speaker panning type.
Definition: AkCommonDefs.h:271
#define AKCODECID_BANK_BUS
Bank encoding for bus banks. These banks are contained in the /bus sub-folder.
Definition: AkTypes.h:1034
const AkUInt32 AK_LE_NATIVE_BITSPERSAMPLE
Native number of bits per sample.
Definition: AkCommonDefs.h:54
bool bPassthrough
Separate pass-through mix is supported.
Definition: AkCommonDefs.h:290
AkUInt16 uMaxFrames
Number of sample frames the buffer can hold. Access through AkAudioBuffer::MaxFrames().
Definition: AkCommonDefs.h:510
AkBehavioralPositioningData behavioral
Positioning data inherited from sound structures and mix busses.
Definition: AkCommonDefs.h:279
AkForceInline void Clear()
Clear the channel config. Becomes "invalid" (IsValid() returns false).
AkReal32 AkSampleType
Audio sample data type (32 bit floating point)
Definition: AkCommonDefs.h:314
const AkUInt32 AK_LE_NATIVE_SAMPLETYPE
Native data type.
Definition: AkCommonDefs.h:55
#define AK_DEFAULT_LISTENER_FRONT_X
Definition: AkCommonDefs.h:225
Ak3dData threeD
3D data used for 3D spatialization.
Definition: AkCommonDefs.h:278
AkForceInline AkUInt32 GetNumNonZeroBits(AkUInt32 in_uWord)
Definition: AkBitFuncs.h:197
Struct containing metering information about a buffer. Depending on when this struct is generated,...
Definition: AkCommonDefs.h:192
AkForceInline AkUInt32 GetBitsPerSample() const
Definition: AkCommonDefs.h:95
@ AK_DataNeeded
The consumer needs more.
Definition: AkTypes.h:160
Positioning data of 3D audio objects.
Definition: AkCommonDefs.h:277
#define AKCODECID_BANK_EVENT
Bank encoding for event banks. These banks are contained in the /event sub-folder.
Definition: AkTypes.h:1033
AkUInt32 uBlockAlign
Number of bytes per sample frame. (For example a 5.1 PCM 16bit should have a uBlockAlign equal to 6(5...
Definition: AkCommonDefs.h:66
AkChannelConfig channelConfig
Channel configuration of the main mix.
Definition: AkCommonDefs.h:287
AkForceInline AkUInt32 GetInterleaveID() const
Definition: AkCommonDefs.h:116
#define AK_DEFAULT_LISTENER_FRONT_Z
Definition: AkCommonDefs.h:227
AkForceInline bool operator!=(const AkAudioFormat &in_other) const
Definition: AkCommonDefs.h:150
#define AKCODECID_BANK
Bank encoding.
Definition: AkTypes.h:1011
void ZeroPadToMaxFrames()
Definition: AkCommonDefs.h:454
AkForceInline bool HasLFE() const
Definition: AkCommonDefs.h:79
@ AK_SpatializationMode_None
No spatialization.
Definition: AkTypes.h:1161
AkForceInline AkUInt32 GetBlockAlign() const
Definition: AkCommonDefs.h:102
AkChannelMask uEmitterChannelMask
Emitter channel mask. With 3D spatialization, zeroed channels should be dropped.
Definition: AkCommonDefs.h:248
uint32_t AkUInt32
Unsigned 32-bit integer.
AkUInt8(* AkChannelMappingFunc)(const AkChannelConfig &config, AkUInt8 idx)
Definition: AkCommonDefs.h:161
AkSpeakerPanningType
Speaker panning type: type of panning logic when object is not 3D spatialized (i.e....
Definition: AkTypes.h:1123
AkUInt32 eConfigType
Channel config type (AkChannelConfigType).
AkReal32 panLR
Pan left-right [-1,1].
Definition: AkCommonDefs.h:266
AkForceInline void AttachContiguousDeinterleavedData(void *in_pData, AkUInt16 in_uMaxFrames, AkUInt16 in_uValidFrames, AkChannelConfig in_channelConfig)
Attach deinterleaved data where channels are contiguous in memory. Allocation is performed outside.
Definition: AkCommonDefs.h:473
AkReal32 spread
Spread [0,1].
Definition: AkCommonDefs.h:246
AkForceInline bool HasLFE() const
AkForceInline bool operator==(const AkAudioFormat &in_other) const
Definition: AkCommonDefs.h:140
AkSampleType * GetLFE()
Definition: AkCommonDefs.h:444
AkForceInline void * GetInterleavedData()
Definition: AkCommonDefs.h:370
AkForceInline AkUInt32 GetNumChannels() const
Definition: AkCommonDefs.h:72
#define AK_SPEAKER_LOW_FREQUENCY
Low-frequency speaker bit mask.
static bool IsBankCodecID(AkUInt32 in_codecID)
Definition: AkCommonDefs.h:210
const AkDataTypeID AK_INT
Integer data type (uchar, short, and so on)
Definition: AkCommonDefs.h:47
#define AkForceInline
Definition: AkTypes.h:63
Defines the parameters of an audio buffer format.
Definition: AkCommonDefs.h:60
AkUInt32 uInterleaveID
Interleave ID (AkDataInterleaveID).
Definition: AkCommonDefs.h:68
bool CheckValidSamples()
Position and orientation of objects in a "local" space.
Definition: AkTypes.h:549
AkForceInline AkUInt32 GetTypeID() const
Definition: AkCommonDefs.h:109
AkForceInline bool IsValid() const
Returns true if valid, false otherwise (as when it is constructed, or invalidated using Clear()).
AkReal32 focus
Focus [0,1].
Definition: AkCommonDefs.h:247
AkTransform xform
Object position / orientation.
Definition: AkCommonDefs.h:245
AkForceInline void ClearData()
Clear data pointer.
Definition: AkCommonDefs.h:331
void AttachInterleavedData(void *in_pData, AkUInt16 in_uMaxFrames, AkUInt16 in_uValidFrames)
Attach interleaved data. Allocation is performed outside.
Definition: AkCommonDefs.h:376
AkUInt32 uSampleRate
Number of samples per second.
Definition: AkCommonDefs.h:61
AK::SpeakerVolumes::VectorPtr peak
Definition: AkCommonDefs.h:195
const AkDataInterleaveID AK_NONINTERLEAVED
Non-interleaved data.
Definition: AkCommonDefs.h:51
Ak3DSpatializationMode spatMode
3D spatialization mode.
Definition: AkCommonDefs.h:270
AkReal32 panBF
Pan back-front [-1,1].
Definition: AkCommonDefs.h:267
const AkDataInterleaveID AK_INTERLEAVED
Interleaved data.
Definition: AkCommonDefs.h:50
void AttachInterleavedData(void *in_pData, AkUInt16 in_uMaxFrames, AkUInt16 in_uValidFrames, AkChannelConfig in_channelConfig)
Attach interleaved data with a new channel config. Allocation is performed outside.
Definition: AkCommonDefs.h:384
void SetAll(AkUInt32 in_uSampleRate, AkChannelConfig in_channelConfig, AkUInt32 in_uBitsPerSample, AkUInt32 in_uBlockAlign, AkUInt32 in_uTypeID, AkUInt32 in_uInterleaveID)
Definition: AkCommonDefs.h:123
const AkUInt32 AK_LE_NATIVE_INTERLEAVE
Native interleaved setting.
Definition: AkCommonDefs.h:56
AkForceInline AkUInt16 MaxFrames() const
Definition: AkCommonDefs.h:500

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