Go to the documentation of this file.
27 #ifndef _AK_SPEAKERCONFIG_H_
28 #define _AK_SPEAKERCONFIG_H_
35 #define AK_SPEAKER_FRONT_LEFT 0x1
36 #define AK_SPEAKER_FRONT_RIGHT 0x2
37 #define AK_SPEAKER_FRONT_CENTER 0x4
38 #define AK_SPEAKER_LOW_FREQUENCY 0x8
39 #define AK_SPEAKER_BACK_LEFT 0x10
40 #define AK_SPEAKER_BACK_RIGHT 0x20
41 #define AK_SPEAKER_BACK_CENTER 0x100
42 #define AK_SPEAKER_SIDE_LEFT 0x200
43 #define AK_SPEAKER_SIDE_RIGHT 0x400
46 #define AK_SPEAKER_TOP 0x800
47 #define AK_SPEAKER_HEIGHT_FRONT_LEFT 0x1000
48 #define AK_SPEAKER_HEIGHT_FRONT_CENTER 0x2000
49 #define AK_SPEAKER_HEIGHT_FRONT_RIGHT 0x4000
50 #define AK_SPEAKER_HEIGHT_BACK_LEFT 0x8000
51 #define AK_SPEAKER_HEIGHT_BACK_CENTER 0x10000
52 #define AK_SPEAKER_HEIGHT_BACK_RIGHT 0x20000
53 #define AK_SPEAKER_HEIGHT_SIDE_LEFT 0x40000
54 #define AK_SPEAKER_HEIGHT_SIDE_RIGHT 0x80000
60 #define AK_SPEAKER_SETUP_MONO AK_SPEAKER_FRONT_CENTER
61 #define AK_SPEAKER_SETUP_0POINT1 AK_SPEAKER_LOW_FREQUENCY
62 #define AK_SPEAKER_SETUP_1POINT1 (AK_SPEAKER_FRONT_CENTER | AK_SPEAKER_LOW_FREQUENCY)
63 #define AK_SPEAKER_SETUP_STEREO (AK_SPEAKER_FRONT_LEFT | AK_SPEAKER_FRONT_RIGHT)
64 #define AK_SPEAKER_SETUP_2POINT1 (AK_SPEAKER_SETUP_STEREO | AK_SPEAKER_LOW_FREQUENCY)
65 #define AK_SPEAKER_SETUP_3STEREO (AK_SPEAKER_SETUP_STEREO | AK_SPEAKER_FRONT_CENTER)
66 #define AK_SPEAKER_SETUP_3POINT1 (AK_SPEAKER_SETUP_3STEREO | AK_SPEAKER_LOW_FREQUENCY)
67 #define AK_SPEAKER_SETUP_4 (AK_SPEAKER_SETUP_STEREO | AK_SPEAKER_SIDE_LEFT | AK_SPEAKER_SIDE_RIGHT)
68 #define AK_SPEAKER_SETUP_4POINT1 (AK_SPEAKER_SETUP_4 | AK_SPEAKER_LOW_FREQUENCY)
69 #define AK_SPEAKER_SETUP_5 (AK_SPEAKER_SETUP_4 | AK_SPEAKER_FRONT_CENTER)
70 #define AK_SPEAKER_SETUP_5POINT1 (AK_SPEAKER_SETUP_5 | AK_SPEAKER_LOW_FREQUENCY)
71 #define AK_SPEAKER_SETUP_6 (AK_SPEAKER_SETUP_4 | AK_SPEAKER_BACK_LEFT | AK_SPEAKER_BACK_RIGHT)
72 #define AK_SPEAKER_SETUP_6POINT1 (AK_SPEAKER_SETUP_6 | AK_SPEAKER_LOW_FREQUENCY)
73 #define AK_SPEAKER_SETUP_7 (AK_SPEAKER_SETUP_6 | AK_SPEAKER_FRONT_CENTER)
74 #define AK_SPEAKER_SETUP_7POINT1 (AK_SPEAKER_SETUP_7 | AK_SPEAKER_LOW_FREQUENCY)
75 #define AK_SPEAKER_SETUP_SURROUND (AK_SPEAKER_SETUP_STEREO | AK_SPEAKER_BACK_CENTER)
77 #define AK_SPEAKER_SETUP_HEIGHT_2 (AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT)
78 #define AK_SPEAKER_SETUP_HEIGHT_4 (AK_SPEAKER_SETUP_HEIGHT_2 | AK_SPEAKER_HEIGHT_BACK_LEFT | AK_SPEAKER_HEIGHT_BACK_RIGHT)
79 #define AK_SPEAKER_SETUP_HEIGHT_5 (AK_SPEAKER_SETUP_HEIGHT_4 | AK_SPEAKER_HEIGHT_FRONT_CENTER)
80 #define AK_SPEAKER_SETUP_HEIGHT_ALL (AK_SPEAKER_SETUP_HEIGHT_5 | AK_SPEAKER_HEIGHT_BACK_CENTER)
81 #define AK_SPEAKER_SETUP_HEIGHT_4_TOP (AK_SPEAKER_SETUP_HEIGHT_4 | AK_SPEAKER_TOP)
82 #define AK_SPEAKER_SETUP_HEIGHT_5_TOP (AK_SPEAKER_SETUP_HEIGHT_5 | AK_SPEAKER_TOP)
85 #define AK_SPEAKER_SETUP_AURO_222 (AK_SPEAKER_SETUP_4 | AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT)
86 #define AK_SPEAKER_SETUP_AURO_8 (AK_SPEAKER_SETUP_AURO_222 | AK_SPEAKER_HEIGHT_BACK_LEFT | AK_SPEAKER_HEIGHT_BACK_RIGHT)
87 #define AK_SPEAKER_SETUP_AURO_9 (AK_SPEAKER_SETUP_AURO_8 | AK_SPEAKER_FRONT_CENTER)
88 #define AK_SPEAKER_SETUP_AURO_9POINT1 (AK_SPEAKER_SETUP_AURO_9 | AK_SPEAKER_LOW_FREQUENCY)
89 #define AK_SPEAKER_SETUP_AURO_10 (AK_SPEAKER_SETUP_AURO_9 | AK_SPEAKER_TOP)
90 #define AK_SPEAKER_SETUP_AURO_10POINT1 (AK_SPEAKER_SETUP_AURO_10 | AK_SPEAKER_LOW_FREQUENCY)
91 #define AK_SPEAKER_SETUP_AURO_11 (AK_SPEAKER_SETUP_AURO_10 | AK_SPEAKER_HEIGHT_FRONT_CENTER)
92 #define AK_SPEAKER_SETUP_AURO_11POINT1 (AK_SPEAKER_SETUP_AURO_11 | AK_SPEAKER_LOW_FREQUENCY)
93 #define AK_SPEAKER_SETUP_AURO_11_740 (AK_SPEAKER_SETUP_7 | AK_SPEAKER_SETUP_HEIGHT_4)
94 #define AK_SPEAKER_SETUP_AURO_11POINT1_740 (AK_SPEAKER_SETUP_AURO_11_740 | AK_SPEAKER_LOW_FREQUENCY)
95 #define AK_SPEAKER_SETUP_AURO_13_751 (AK_SPEAKER_SETUP_7 | AK_SPEAKER_SETUP_HEIGHT_5 | AK_SPEAKER_TOP)
96 #define AK_SPEAKER_SETUP_AURO_13POINT1_751 (AK_SPEAKER_SETUP_AURO_13_751 | AK_SPEAKER_LOW_FREQUENCY)
99 #define AK_SPEAKER_SETUP_DOLBY_5_0_2 (AK_SPEAKER_SETUP_5 | AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT )
100 #define AK_SPEAKER_SETUP_DOLBY_5_1_2 (AK_SPEAKER_SETUP_DOLBY_5_0_2 | AK_SPEAKER_LOW_FREQUENCY )
101 #define AK_SPEAKER_SETUP_DOLBY_5_0_4 (AK_SPEAKER_SETUP_DOLBY_5_0_2 | AK_SPEAKER_HEIGHT_BACK_LEFT | AK_SPEAKER_HEIGHT_BACK_RIGHT )
102 #define AK_SPEAKER_SETUP_DOLBY_5_1_4 (AK_SPEAKER_SETUP_DOLBY_5_0_4 | AK_SPEAKER_LOW_FREQUENCY )
103 #define AK_SPEAKER_SETUP_DOLBY_6_0_2 (AK_SPEAKER_SETUP_6 | AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT )
104 #define AK_SPEAKER_SETUP_DOLBY_6_1_2 (AK_SPEAKER_SETUP_DOLBY_6_0_2 | AK_SPEAKER_LOW_FREQUENCY )
105 #define AK_SPEAKER_SETUP_DOLBY_6_0_4 (AK_SPEAKER_SETUP_DOLBY_6_0_2 | AK_SPEAKER_HEIGHT_BACK_LEFT | AK_SPEAKER_HEIGHT_BACK_RIGHT )
106 #define AK_SPEAKER_SETUP_DOLBY_6_1_4 (AK_SPEAKER_SETUP_DOLBY_6_0_4 | AK_SPEAKER_LOW_FREQUENCY )
107 #define AK_SPEAKER_SETUP_DOLBY_7_0_2 (AK_SPEAKER_SETUP_7 | AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT )
108 #define AK_SPEAKER_SETUP_DOLBY_7_1_2 (AK_SPEAKER_SETUP_DOLBY_7_0_2 | AK_SPEAKER_LOW_FREQUENCY )
109 #define AK_SPEAKER_SETUP_DOLBY_7_0_4 (AK_SPEAKER_SETUP_DOLBY_7_0_2 | AK_SPEAKER_HEIGHT_BACK_LEFT | AK_SPEAKER_HEIGHT_BACK_RIGHT )
110 #define AK_SPEAKER_SETUP_DOLBY_7_1_4 (AK_SPEAKER_SETUP_DOLBY_7_0_4 | AK_SPEAKER_LOW_FREQUENCY )
112 #define AK_SPEAKER_SETUP_ALL_SPEAKERS (AK_SPEAKER_SETUP_7POINT1 | AK_SPEAKER_BACK_CENTER | AK_SPEAKER_SETUP_HEIGHT_ALL | AK_SPEAKER_TOP)
118 #define AK_IDX_SETUP_FRONT_LEFT (0)
119 #define AK_IDX_SETUP_FRONT_RIGHT (1)
120 #define AK_IDX_SETUP_CENTER (2)
122 #define AK_IDX_SETUP_NOCENTER_BACK_LEFT (2)
123 #define AK_IDX_SETUP_NOCENTER_BACK_RIGHT (3)
124 #define AK_IDX_SETUP_NOCENTER_SIDE_LEFT (4)
125 #define AK_IDX_SETUP_NOCENTER_SIDE_RIGHT (5)
127 #define AK_IDX_SETUP_WITHCENTER_BACK_LEFT (3)
128 #define AK_IDX_SETUP_WITHCENTER_BACK_RIGHT (4)
129 #define AK_IDX_SETUP_WITHCENTER_SIDE_LEFT (5)
130 #define AK_IDX_SETUP_WITHCENTER_SIDE_RIGHT (6)
132 #define AK_IDX_SETUP_WITHCENTER_HEIGHT_FRONT_LEFT (7)
133 #define AK_IDX_SETUP_WITHCENTER_HEIGHT_FRONT_RIGHT (8)
134 #define AK_IDX_SETUP_WITHCENTER_HEIGHT_BACK_LEFT (9)
135 #define AK_IDX_SETUP_WITHCENTER_HEIGHT_BACK_RIGHT (10)
138 #define AK_IDX_SETUP_0_LFE (0)
140 #define AK_IDX_SETUP_1_CENTER (0)
141 #define AK_IDX_SETUP_1_LFE (1)
143 #define AK_IDX_SETUP_2_LEFT (0)
144 #define AK_IDX_SETUP_2_RIGHT (1)
145 #define AK_IDX_SETUP_2_LFE (2)
147 #define AK_IDX_SETUP_3_LEFT (0)
148 #define AK_IDX_SETUP_3_RIGHT (1)
149 #define AK_IDX_SETUP_3_CENTER (2)
150 #define AK_IDX_SETUP_3_LFE (3)
152 #define AK_IDX_SETUP_4_FRONTLEFT (0)
153 #define AK_IDX_SETUP_4_FRONTRIGHT (1)
154 #define AK_IDX_SETUP_4_REARLEFT (2)
155 #define AK_IDX_SETUP_4_REARRIGHT (3)
156 #define AK_IDX_SETUP_4_LFE (4)
158 #define AK_IDX_SETUP_5_FRONTLEFT (0)
159 #define AK_IDX_SETUP_5_FRONTRIGHT (1)
160 #define AK_IDX_SETUP_5_CENTER (2)
161 #define AK_IDX_SETUP_5_REARLEFT (3)
162 #define AK_IDX_SETUP_5_REARRIGHT (4)
163 #define AK_IDX_SETUP_5_LFE (5)
165 #define AK_IDX_SETUP_6_FRONTLEFT (0)
166 #define AK_IDX_SETUP_6_FRONTRIGHT (1)
167 #define AK_IDX_SETUP_6_REARLEFT (2)
168 #define AK_IDX_SETUP_6_REARRIGHT (3)
169 #define AK_IDX_SETUP_6_SIDELEFT (4)
170 #define AK_IDX_SETUP_6_SIDERIGHT (5)
171 #define AK_IDX_SETUP_6_LFE (6)
173 #define AK_IDX_SETUP_7_FRONTLEFT (0)
174 #define AK_IDX_SETUP_7_FRONTRIGHT (1)
175 #define AK_IDX_SETUP_7_CENTER (2)
176 #define AK_IDX_SETUP_7_REARLEFT (3)
177 #define AK_IDX_SETUP_7_REARRIGHT (4)
178 #define AK_IDX_SETUP_7_SIDELEFT (5)
179 #define AK_IDX_SETUP_7_SIDERIGHT (6)
180 #define AK_IDX_SETUP_7_LFE (7)
187 #define AK_SPEAKER_SETUP_0_1 ( AK_SPEAKER_LOW_FREQUENCY ) //0.1
189 #define AK_SPEAKER_SETUP_1_0_CENTER ( AK_SPEAKER_FRONT_CENTER ) //1.0 (C)
190 #define AK_SPEAKER_SETUP_1_1_CENTER ( AK_SPEAKER_FRONT_CENTER | AK_SPEAKER_LOW_FREQUENCY ) //1.1 (C)
192 #define AK_SPEAKER_SETUP_2_0 ( AK_SPEAKER_FRONT_LEFT | AK_SPEAKER_FRONT_RIGHT ) //2.0
193 #define AK_SPEAKER_SETUP_2_1 ( AK_SPEAKER_FRONT_LEFT | AK_SPEAKER_FRONT_RIGHT | AK_SPEAKER_LOW_FREQUENCY ) //2.1
195 #define AK_SPEAKER_SETUP_3_0 ( AK_SPEAKER_FRONT_LEFT | AK_SPEAKER_FRONT_RIGHT | AK_SPEAKER_FRONT_CENTER ) //3.0
196 #define AK_SPEAKER_SETUP_3_1 ( AK_SPEAKER_SETUP_3_0 | AK_SPEAKER_LOW_FREQUENCY ) //3.1
198 #define AK_SPEAKER_SETUP_FRONT ( AK_SPEAKER_SETUP_3_0 )
200 #define AK_SPEAKER_SETUP_4_0 ( AK_SPEAKER_SETUP_4 )
201 #define AK_SPEAKER_SETUP_4_1 ( AK_SPEAKER_SETUP_4POINT1 )
202 #define AK_SPEAKER_SETUP_5_0 ( AK_SPEAKER_SETUP_5 )
203 #define AK_SPEAKER_SETUP_5_1 ( AK_SPEAKER_SETUP_5POINT1 )
205 #define AK_SPEAKER_SETUP_6_0 ( AK_SPEAKER_SETUP_6 )
206 #define AK_SPEAKER_SETUP_6_1 ( AK_SPEAKER_SETUP_6POINT1 )
207 #define AK_SPEAKER_SETUP_7_0 ( AK_SPEAKER_SETUP_7 )
208 #define AK_SPEAKER_SETUP_7_1 ( AK_SPEAKER_SETUP_7POINT1 )
211 #define AK_SPEAKER_SETUP_DEFAULT_PLANE (AK_SPEAKER_SETUP_7POINT1)
212 #define AK_SUPPORTED_STANDARD_CHANNEL_MASK (AK_SPEAKER_SETUP_ALL_SPEAKERS)
213 #define AK_STANDARD_MAX_NUM_CHANNELS (8)
215 #define AK_MAX_AMBISONICS_ORDER (5)
217 #define AK_DEFAULT_HEIGHT_ANGLE 30.f
276 switch ( in_uNumChannels )
406 return in_uChannelMask;
499 return (*((
AkUInt32*)
this) != in_uBitField);
585 eConfigType = (in_uChannelConfig >> 8) & 0x0000000f;
596 AKASSERT(uNumLFEChannel == 0 || uNumLFEChannel == 1);
610 AKASSERT(uNumCenterChannel == 0 || uNumCenterChannel == 1);
650 #endif //_AK_SPEAKERCONFIG_H_
AkForceInline bool operator!=(AkUInt32 in_uBitField)
Operator != with a 32-bit word.
AkForceInline bool HasLFE(AkChannelMask in_uChannelMask)
AkForceInline void SetStandardOrAnonymous(AkUInt32 in_uNumChannels, AkUInt32 in_uChannelMask)
Set channel config as either a standard or an anonymous configuration, specified with both a given ch...
static AkForceInline AkChannelConfig Ambisonic(AkUInt32 in_uNumChannels)
Construct ambisonic channel config from number of channels (NOT order)
#define AK_SPEAKER_SETUP_5_0
Definition of data structures for AkAudioObject.
AkForceInline bool HasCenter() const
@ AK_ChannelConfigType_Last
End of enum, invalid value.
AkForceInline AkChannelMask BackToSideChannels(AkChannelMask in_uChannelMask)
AkUInt32 uNumChannels
Number of channels.
void AK_SPEAKER_SETUP_FIX_REAR_TO_SIDE(AkUInt32 &io_uChannelMask)
#define AK_SPEAKER_SETUP_1_0_CENTER
AkUInt32 uChannelMask
Channel mask (configuration).
@ ChannelOrdering_Standard
@ AK_ChannelConfigType_Standard
Channels must be identified with standard defines in AkSpeakerConfigs.
AkForceInline bool HasCenter(AkChannelMask in_uChannelMask)
#define AK_SPEAKER_SETUP_7POINT1
7.1 setup channel mask
#define AK_SPEAKER_BACK_LEFT
Rear left speaker bit mask.
AkUInt32 AkChannelMask
Channel mask (similar to WAVE_FORMAT_EXTENSIBLE). Bit values are defined in AkSpeakerConfig....
uint8_t AkUInt8
Unsigned 8-bit integer.
AkForceInline AkChannelConfig()
Constructor. Clears / sets the channel config in "invalid" state (IsValid() returns false).
AkForceInline void SetAmbisonic(AkUInt32 in_uNumChannels)
Set channel config as an ambisonic configuration specified with given number of channels.
AkForceInline AkUInt32 AkPopCount(AkUInt32 in_bits)
@ AK_ChannelConfigType_Objects
Object-based configurations.
#define AK_SPEAKER_FRONT_RIGHT
Front right speaker bit mask.
AkForceInline AkUInt32 Serialize() const
Serialize channel config into a 32-bit word.
@ AK_ChannelConfigType_Ambisonic
Ambisonics. Channel mask == 0 and channels follow standard ambisonic order.
AkForceInline void SetSameAsPassthrough()
Set channel config as the passthrough mix channel configuration.
AkForceInline void SetAnonymous(AkUInt32 in_uNumChannels)
Set channel config as an anonymous configuration specified with given number of channels.
AkForceInline AkChannelConfig RemoveCenter() const
Returns a new config based on 'this' with no Front Center channel.
static AkUInt8 ChannelBitToIndex(AkChannelMask in_uChannelBit, AkChannelMask in_uChannelMask)
#define AK_SPEAKER_SETUP_DEFAULT_PLANE
All speakers on the plane, supported on this platform.
AkForceInline bool operator!=(const AkChannelConfig &in_other) const
Operator !=.
@ AK_ChannelConfigType_UseDevicePassthrough
Special setting for bus objects to use the audio device passthrough configuration.
AkForceInline AkUInt32 GetNumberOfAnglesForConfig(AkChannelMask in_uChannelMask)
static AkForceInline AkChannelConfig Anonymous(AkUInt32 in_uNumChannels)
#define AK_SPEAKER_SIDE_LEFT
Side left speaker bit mask.
#define AKASSERT(Condition)
#define AK_SPEAKER_BACK_CENTER
Rear center speaker ("surround speaker") bit mask.
static AkChannelMask ChannelMaskFromNumChannels(unsigned int in_uNumChannels)
AkForceInline void Clear()
Clear the channel config. Becomes "invalid" (IsValid() returns false).
AkForceInline void SetSameAsMainMix()
Set channel config as the main mix channel configuration.
#define AK_SPEAKER_SETUP_5_1
AkChannelConfigType
Channel configuration type.
AkForceInline bool HasHeightChannels(AkChannelMask in_uChannelMask)
Returns true if standard configuration represented by channel mask has at least one "height" channel ...
static AkForceInline AkChannelConfig Object()
#define AK_SPEAKER_SETUP_7
7.0 setup channel mask
AkForceInline void SetObject()
Set channel config as an object-based configuration (implies dynamic number of objects).
#define AK_SPEAKER_SETUP_2_1
@ AK_ChannelConfigType_Anonymous
Channel mask == 0 and channels are anonymous.
AkForceInline bool HasSurroundChannels(AkChannelMask in_uChannelMask)
#define AK_SPEAKER_SETUP_2_0
AkForceInline bool operator==(const AkChannelConfig &in_other) const
Operator ==.
AkForceInline AkChannelConfig RemoveLFE() const
Returns a new config based on 'this' with no LFE.
AkForceInline void SetStandard(AkUInt32 in_uChannelMask)
Set channel config as a standard configuration specified with given channel mask.
#define AK_SPEAKER_FRONT_LEFT
Standard speakers (channel mask):
AkForceInline AkChannelConfig(AkUInt32 in_uNumChannels, AkUInt32 in_uChannelMask)
Constructor. Sets number of channels, and config type according to whether channel mask is defined or...
uint32_t AkUInt32
Unsigned 32-bit integer.
AkUInt32 eConfigType
Channel config type (AkChannelConfigType).
@ AK_ChannelConfigType_UseDeviceMain
Special setting for bus objects to use the audio device main configuration.
AkForceInline bool HasSideAndRearChannels(AkChannelMask in_uChannelMask)
AkForceInline bool HasLFE() const
static AkUInt8 ChannelMaskToNumChannels(AkChannelMask in_uChannelMask)
Returns the number of channels of a given channel configuration.
void AK_SPEAKER_SETUP_CONVERT_TO_SUPPORTED(AkUInt32 &io_uChannelMask)
AkChannelOrdering
Channel ordering type.
#define AK_SPEAKER_LOW_FREQUENCY
Low-frequency speaker bit mask.
AkForceInline void Deserialize(AkUInt32 in_uChannelConfig)
Deserialize channel config from a 32-bit word.
#define AK_SPEAKER_FRONT_CENTER
Front center speaker bit mask.
void AK_SPEAKER_SETUP_FIX_LEFT_TO_CENTER(AkUInt32 &io_uChannelMask)
@ ChannelOrdering_RunTime
static AkForceInline AkChannelConfig Standard(AkUInt32 in_uChannelMask)
Construct standard channel config from channel mask.
AkForceInline bool IsValid() const
Returns true if valid, false otherwise (as when it is constructed, or invalidated using Clear()).
#define AK_SPEAKER_SETUP_4_0
#define AK_SPEAKER_BACK_RIGHT
Rear right speaker bit mask.
#define AK_SPEAKER_SIDE_RIGHT
Side right speaker bit mask.
AkForceInline bool HasStrictlyOnePairOfSurroundChannels(AkChannelMask in_uChannelMask)
Tell us about your project. We're here to help.
Register your project and we'll help you get started with no strings attached!
Get started with Wwise