版本
menu

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

此页面对您是否有帮助?

需要技术支持?

仍有疑问?或者问题?需要更多信息?欢迎联系我们,我们可以提供帮助!

查看我们的“技术支持”页面

介绍一下自己的项目。我们会竭力为您提供帮助。

来注册自己的项目,我们帮您快速入门,不带任何附加条件!

开始 Wwise 之旅