Version
menu_open
link
Wwise SDK 2022.1.7
AkSpeakerConfig.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) 2023 Audiokinetic Inc.
25 *******************************************************************************/
26 
27 #ifndef _AK_SPEAKERCONFIG_H_
28 #define _AK_SPEAKERCONFIG_H_
29 
31 
32 /// Standard speakers (channel mask):
33 #define AK_SPEAKER_FRONT_LEFT 0x1 ///< Front left speaker bit mask
34 #define AK_SPEAKER_FRONT_RIGHT 0x2 ///< Front right speaker bit mask
35 #define AK_SPEAKER_FRONT_CENTER 0x4 ///< Front center speaker bit mask
36 #define AK_SPEAKER_LOW_FREQUENCY 0x8 ///< Low-frequency speaker bit mask
37 #define AK_SPEAKER_BACK_LEFT 0x10 ///< Rear left speaker bit mask
38 #define AK_SPEAKER_BACK_RIGHT 0x20 ///< Rear right speaker bit mask
39 #define AK_SPEAKER_BACK_CENTER 0x100 ///< Rear center speaker ("surround speaker") bit mask
40 #define AK_SPEAKER_SIDE_LEFT 0x200 ///< Side left speaker bit mask
41 #define AK_SPEAKER_SIDE_RIGHT 0x400 ///< Side right speaker bit mask
42 
43 /// "Height" speakers.
44 #define AK_SPEAKER_TOP 0x800 ///< Top speaker bit mask
45 #define AK_SPEAKER_HEIGHT_FRONT_LEFT 0x1000 ///< Front left speaker bit mask
46 #define AK_SPEAKER_HEIGHT_FRONT_CENTER 0x2000 ///< Front center speaker bit mask
47 #define AK_SPEAKER_HEIGHT_FRONT_RIGHT 0x4000 ///< Front right speaker bit mask
48 #define AK_SPEAKER_HEIGHT_BACK_LEFT 0x8000 ///< Rear left speaker bit mask
49 #define AK_SPEAKER_HEIGHT_BACK_CENTER 0x10000 ///< Rear center speaker bit mask
50 #define AK_SPEAKER_HEIGHT_BACK_RIGHT 0x20000 ///< Rear right speaker bit mask
51 
52 //
53 // Supported speaker setups. Those are the ones that can be used in the Wwise Sound Engine audio pipeline.
54 //
55 
56 #define AK_SPEAKER_SETUP_MONO AK_SPEAKER_FRONT_CENTER ///< 1.0 setup channel mask
57 #define AK_SPEAKER_SETUP_0POINT1 AK_SPEAKER_LOW_FREQUENCY ///< 0.1 setup channel mask
58 #define AK_SPEAKER_SETUP_1POINT1 (AK_SPEAKER_FRONT_CENTER | AK_SPEAKER_LOW_FREQUENCY) ///< 1.1 setup channel mask
59 #define AK_SPEAKER_SETUP_STEREO (AK_SPEAKER_FRONT_LEFT | AK_SPEAKER_FRONT_RIGHT) ///< 2.0 setup channel mask
60 #define AK_SPEAKER_SETUP_2POINT1 (AK_SPEAKER_SETUP_STEREO | AK_SPEAKER_LOW_FREQUENCY) ///< 2.1 setup channel mask
61 #define AK_SPEAKER_SETUP_3STEREO (AK_SPEAKER_SETUP_STEREO | AK_SPEAKER_FRONT_CENTER) ///< 3.0 setup channel mask
62 #define AK_SPEAKER_SETUP_3POINT1 (AK_SPEAKER_SETUP_3STEREO | AK_SPEAKER_LOW_FREQUENCY) ///< 3.1 setup channel mask
63 #define AK_SPEAKER_SETUP_4 (AK_SPEAKER_SETUP_STEREO | AK_SPEAKER_SIDE_LEFT | AK_SPEAKER_SIDE_RIGHT) ///< 4.0 setup channel mask
64 #define AK_SPEAKER_SETUP_4POINT1 (AK_SPEAKER_SETUP_4 | AK_SPEAKER_LOW_FREQUENCY) ///< 4.1 setup channel mask
65 #define AK_SPEAKER_SETUP_5 (AK_SPEAKER_SETUP_4 | AK_SPEAKER_FRONT_CENTER) ///< 5.0 setup channel mask
66 #define AK_SPEAKER_SETUP_5POINT1 (AK_SPEAKER_SETUP_5 | AK_SPEAKER_LOW_FREQUENCY) ///< 5.1 setup channel mask
67 #define AK_SPEAKER_SETUP_6 (AK_SPEAKER_SETUP_4 | AK_SPEAKER_BACK_LEFT | AK_SPEAKER_BACK_RIGHT) ///< 6.0 setup channel mask
68 #define AK_SPEAKER_SETUP_6POINT1 (AK_SPEAKER_SETUP_6 | AK_SPEAKER_LOW_FREQUENCY) ///< 6.1 setup channel mask
69 #define AK_SPEAKER_SETUP_7 (AK_SPEAKER_SETUP_6 | AK_SPEAKER_FRONT_CENTER) ///< 7.0 setup channel mask
70 #define AK_SPEAKER_SETUP_7POINT1 (AK_SPEAKER_SETUP_7 | AK_SPEAKER_LOW_FREQUENCY) ///< 7.1 setup channel mask
71 #define AK_SPEAKER_SETUP_SURROUND (AK_SPEAKER_SETUP_STEREO | AK_SPEAKER_BACK_CENTER) ///< Legacy surround setup channel mask
72 
73 // Note. DPL2 does not really have 4 channels, but it is used by plugins to differentiate from stereo setup.
74 #define AK_SPEAKER_SETUP_DPL2 (AK_SPEAKER_SETUP_4) ///< Legacy DPL2 setup channel mask
75 
76 #define AK_SPEAKER_SETUP_HEIGHT_2 (AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT) ///< 2 speaker height layer.
77 #define AK_SPEAKER_SETUP_HEIGHT_4 (AK_SPEAKER_SETUP_HEIGHT_2 | AK_SPEAKER_HEIGHT_BACK_LEFT | AK_SPEAKER_HEIGHT_BACK_RIGHT) ///< 4 speaker height layer.
78 #define AK_SPEAKER_SETUP_HEIGHT_5 (AK_SPEAKER_SETUP_HEIGHT_4 | AK_SPEAKER_HEIGHT_FRONT_CENTER) ///< 5 speaker height layer.
79 #define AK_SPEAKER_SETUP_HEIGHT_ALL (AK_SPEAKER_SETUP_HEIGHT_5 | AK_SPEAKER_HEIGHT_BACK_CENTER) ///< All height speaker layer.
80 #define AK_SPEAKER_SETUP_HEIGHT_4_TOP (AK_SPEAKER_SETUP_HEIGHT_4 | AK_SPEAKER_TOP) ///< 4 speaker height layer + top.
81 #define AK_SPEAKER_SETUP_HEIGHT_5_TOP (AK_SPEAKER_SETUP_HEIGHT_5 | AK_SPEAKER_TOP) ///< 5 speaker height layer + top.
82 
83 // Auro speaker setups
84 #define AK_SPEAKER_SETUP_AURO_222 (AK_SPEAKER_SETUP_4 | AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT) ///< Auro-222 setup channel mask (4.0.2)
85 #define AK_SPEAKER_SETUP_AURO_8 (AK_SPEAKER_SETUP_AURO_222 | AK_SPEAKER_HEIGHT_BACK_LEFT | AK_SPEAKER_HEIGHT_BACK_RIGHT) ///< Auro-8 setup channel mask (4.0.4)
86 #define AK_SPEAKER_SETUP_AURO_9 (AK_SPEAKER_SETUP_AURO_8 | AK_SPEAKER_FRONT_CENTER) ///< Auro-9.0 setup channel mask (5.0.4)
87 #define AK_SPEAKER_SETUP_AURO_9POINT1 (AK_SPEAKER_SETUP_AURO_9 | AK_SPEAKER_LOW_FREQUENCY) ///< Auro-9.1 setup channel mask (5.1.4)
88 #define AK_SPEAKER_SETUP_AURO_10 (AK_SPEAKER_SETUP_AURO_9 | AK_SPEAKER_TOP) ///< Auro-10.0 setup channel mask (5.0.4+top)
89 #define AK_SPEAKER_SETUP_AURO_10POINT1 (AK_SPEAKER_SETUP_AURO_10 | AK_SPEAKER_LOW_FREQUENCY) ///< Auro-10.1 setup channel mask (5.1.4+top)
90 #define AK_SPEAKER_SETUP_AURO_11 (AK_SPEAKER_SETUP_AURO_10 | AK_SPEAKER_HEIGHT_FRONT_CENTER) ///< Auro-11.0 setup channel mask (5.0.5+top)
91 #define AK_SPEAKER_SETUP_AURO_11POINT1 (AK_SPEAKER_SETUP_AURO_11 | AK_SPEAKER_LOW_FREQUENCY) ///< Auro-11.1 setup channel mask (5.1.5+top)
92 #define AK_SPEAKER_SETUP_AURO_11_740 (AK_SPEAKER_SETUP_7 | AK_SPEAKER_SETUP_HEIGHT_4) ///< Auro-11.0 (7+4) setup channel mask (7.0.4)
93 #define AK_SPEAKER_SETUP_AURO_11POINT1_740 (AK_SPEAKER_SETUP_AURO_11_740 | AK_SPEAKER_LOW_FREQUENCY) ///< Auro-11.1 (7+4) setup channel mask (7.1.4)
94 #define AK_SPEAKER_SETUP_AURO_13_751 (AK_SPEAKER_SETUP_7 | AK_SPEAKER_SETUP_HEIGHT_5 | AK_SPEAKER_TOP) ///< Auro-13.0 setup channel mask (7.0.5+top)
95 #define AK_SPEAKER_SETUP_AURO_13POINT1_751 (AK_SPEAKER_SETUP_AURO_13_751 | AK_SPEAKER_LOW_FREQUENCY) ///< Auro-13.1 setup channel mask (7.1.5+top)
96 
97 // Dolby speaker setups: in Dolby nomenclature, [#plane].[lfe].[#height]
98 #define AK_SPEAKER_SETUP_DOLBY_5_0_2 (AK_SPEAKER_SETUP_5 | AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT ) ///< Dolby 5.0.2 setup channel mask
99 #define AK_SPEAKER_SETUP_DOLBY_5_1_2 (AK_SPEAKER_SETUP_DOLBY_5_0_2 | AK_SPEAKER_LOW_FREQUENCY ) ///< Dolby 5.1.2 setup channel mask
100 #define AK_SPEAKER_SETUP_DOLBY_6_0_2 (AK_SPEAKER_SETUP_6 | AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT ) ///< Dolby 6.0.2 setup channel mask
101 #define AK_SPEAKER_SETUP_DOLBY_6_1_2 (AK_SPEAKER_SETUP_DOLBY_6_0_2 | AK_SPEAKER_LOW_FREQUENCY ) ///< Dolby 6.1.2 setup channel mask
102 #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 ) ///< Dolby 6.0.4 setup channel mask
103 #define AK_SPEAKER_SETUP_DOLBY_6_1_4 (AK_SPEAKER_SETUP_DOLBY_6_0_4 | AK_SPEAKER_LOW_FREQUENCY ) ///< Dolby 6.1.4 setup channel mask
104 #define AK_SPEAKER_SETUP_DOLBY_7_0_2 (AK_SPEAKER_SETUP_7 | AK_SPEAKER_HEIGHT_FRONT_LEFT | AK_SPEAKER_HEIGHT_FRONT_RIGHT ) ///< Dolby 7.0.2 setup channel mask
105 #define AK_SPEAKER_SETUP_DOLBY_7_1_2 (AK_SPEAKER_SETUP_DOLBY_7_0_2 | AK_SPEAKER_LOW_FREQUENCY ) ///< Dolby 7.1.2 setup channel mask
106 #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 ) ///< Dolby 7.0.4 setup channel mask
107 #define AK_SPEAKER_SETUP_DOLBY_7_1_4 (AK_SPEAKER_SETUP_DOLBY_7_0_4 | AK_SPEAKER_LOW_FREQUENCY ) ///< Dolby 7.1.4 setup channel mask
108 
109 #define AK_SPEAKER_SETUP_ALL_SPEAKERS (AK_SPEAKER_SETUP_7POINT1 | AK_SPEAKER_BACK_CENTER | AK_SPEAKER_SETUP_HEIGHT_ALL | AK_SPEAKER_TOP) ///< All speakers.
110 
111 // Channel indices.
112 // ------------------------------------------------
113 
114 // Channel indices for standard setups on the plane.
115 #define AK_IDX_SETUP_FRONT_LEFT (0) ///< Index of front-left channel in all configurations.
116 #define AK_IDX_SETUP_FRONT_RIGHT (1) ///< Index of front-right channel in all configurations.
117 #define AK_IDX_SETUP_CENTER (2) ///< Index of front-center channel in all configurations.
118 
119 #define AK_IDX_SETUP_NOCENTER_BACK_LEFT (2) ///< Index of back-left channel in configurations with no front-center channel.
120 #define AK_IDX_SETUP_NOCENTER_BACK_RIGHT (3) ///< Index of back-right channel in configurations with no front-center channel.
121 #define AK_IDX_SETUP_NOCENTER_SIDE_LEFT (4) ///< Index of side-left channel in configurations with no front-center channel.
122 #define AK_IDX_SETUP_NOCENTER_SIDE_RIGHT (5) ///< Index of side-right channel in configurations with no front-center channel.
123 
124 #define AK_IDX_SETUP_WITHCENTER_BACK_LEFT (3) ///< Index of back-left channel in configurations with a front-center channel.
125 #define AK_IDX_SETUP_WITHCENTER_BACK_RIGHT (4) ///< Index of back-right channel in configurations with a front-center channel.
126 #define AK_IDX_SETUP_WITHCENTER_SIDE_LEFT (5) ///< Index of side-left channel in configurations with a front-center channel.
127 #define AK_IDX_SETUP_WITHCENTER_SIDE_RIGHT (6) ///< Index of side-right channel in configurations with a front-center channel.
128 
129 // Channel indices for specific setups.
130 #define AK_IDX_SETUP_0_LFE (0) ///< Index of low-frequency channel in 0.1 setup (use with AkAudioBuffer::GetChannel())
131 
132 #define AK_IDX_SETUP_1_CENTER (0) ///< Index of center channel in 1.x setups (use with AkAudioBuffer::GetChannel())
133 #define AK_IDX_SETUP_1_LFE (1) ///< Index of low-frequency channel in 1.1 setup (use with AkAudioBuffer::GetChannel())
134 
135 #define AK_IDX_SETUP_2_LEFT (0) ///< Index of left channel in 2.x setups (use with AkAudioBuffer::GetChannel())
136 #define AK_IDX_SETUP_2_RIGHT (1) ///< Index of right channel in 2.x setups (use with AkAudioBuffer::GetChannel())
137 #define AK_IDX_SETUP_2_LFE (2) ///< Index of low-frequency channel in 2.1 setup (use with AkAudioBuffer::GetChannel())
138 
139 #define AK_IDX_SETUP_3_LEFT (0) ///< Index of left channel in 3.x setups (use with AkAudioBuffer::GetChannel())
140 #define AK_IDX_SETUP_3_RIGHT (1) ///< Index of right channel in 3.x setups (use with AkAudioBuffer::GetChannel())
141 #define AK_IDX_SETUP_3_CENTER (2) ///< Index of center channel in 3.x setups (use with AkAudioBuffer::GetChannel())
142 #define AK_IDX_SETUP_3_LFE (3) ///< Index of low-frequency channel in 3.1 setup (use with AkAudioBuffer::GetChannel())
143 
144 #define AK_IDX_SETUP_4_FRONTLEFT (0) ///< Index of front left channel in 4.x setups (use with AkAudioBuffer::GetChannel())
145 #define AK_IDX_SETUP_4_FRONTRIGHT (1) ///< Index of front right channel in 4.x setups (use with AkAudioBuffer::GetChannel())
146 #define AK_IDX_SETUP_4_REARLEFT (2) ///< Index of rear left channel in 4.x setups (use with AkAudioBuffer::GetChannel())
147 #define AK_IDX_SETUP_4_REARRIGHT (3) ///< Index of rear right channel in 4.x setups (use with AkAudioBuffer::GetChannel())
148 #define AK_IDX_SETUP_4_LFE (4) ///< Index of low-frequency channel in 4.1 setup (use with AkAudioBuffer::GetChannel())
149 
150 #define AK_IDX_SETUP_5_FRONTLEFT (0) ///< Index of front left channel in 5.x setups (use with AkAudioBuffer::GetChannel())
151 #define AK_IDX_SETUP_5_FRONTRIGHT (1) ///< Index of front right channel in 5.x setups (use with AkAudioBuffer::GetChannel())
152 #define AK_IDX_SETUP_5_CENTER (2) ///< Index of center channel in 5.x setups (use with AkAudioBuffer::GetChannel())
153 #define AK_IDX_SETUP_5_REARLEFT (3) ///< Index of rear left channel in 5.x setups (use with AkAudioBuffer::GetChannel())
154 #define AK_IDX_SETUP_5_REARRIGHT (4) ///< Index of rear right channel in 5.x setups (use with AkAudioBuffer::GetChannel())
155 #define AK_IDX_SETUP_5_LFE (5) ///< Index of low-frequency channel in 5.1 setup (use with AkAudioBuffer::GetChannel())
156 
157 #define AK_IDX_SETUP_6_FRONTLEFT (0) ///< Index of front left channel in 6.x setups (use with AkAudioBuffer::GetChannel())
158 #define AK_IDX_SETUP_6_FRONTRIGHT (1) ///< Index of front right channel in 6x setups (use with AkAudioBuffer::GetChannel())
159 #define AK_IDX_SETUP_6_REARLEFT (2) ///< Index of rear left channel in 6.x setups (use with AkAudioBuffer::GetChannel())
160 #define AK_IDX_SETUP_6_REARRIGHT (3) ///< Index of rear right channel in 6.x setups (use with AkAudioBuffer::GetChannel())
161 #define AK_IDX_SETUP_6_SIDELEFT (4) ///< Index of side left channel in 6.x setups (use with AkAudioBuffer::GetChannel())
162 #define AK_IDX_SETUP_6_SIDERIGHT (5) ///< Index of side right channel in 6.x setups (use with AkAudioBuffer::GetChannel())
163 #define AK_IDX_SETUP_6_LFE (6) ///< Index of low-frequency channel in 6.1 setup (use with AkAudioBuffer::GetChannel())
164 
165 #define AK_IDX_SETUP_7_FRONTLEFT (0) ///< Index of front left channel in 7.x setups (use with AkAudioBuffer::GetChannel())
166 #define AK_IDX_SETUP_7_FRONTRIGHT (1) ///< Index of front right channel in 7.x setups (use with AkAudioBuffer::GetChannel())
167 #define AK_IDX_SETUP_7_CENTER (2) ///< Index of center channel in 7.x setups (use with AkAudioBuffer::GetChannel())
168 #define AK_IDX_SETUP_7_REARLEFT (3) ///< Index of rear left channel in 7.x setups (use with AkAudioBuffer::GetChannel())
169 #define AK_IDX_SETUP_7_REARRIGHT (4) ///< Index of rear right channel in 7.x setups (use with AkAudioBuffer::GetChannel())
170 #define AK_IDX_SETUP_7_SIDELEFT (5) ///< Index of side left channel in 7.x setups (use with AkAudioBuffer::GetChannel())
171 #define AK_IDX_SETUP_7_SIDERIGHT (6) ///< Index of side right channel in 7.x setups (use with AkAudioBuffer::GetChannel())
172 #define AK_IDX_SETUP_7_LFE (7) ///< Index of low-frequency channel in 7.1 setup (use with AkAudioBuffer::GetChannel())
173 
174 //
175 // Extra speaker setups. This is a more exhaustive list of speaker setups, which might not all be supported
176 // by the Wwise Sound Engine audio pipeline.
177 //
178 
179 #define AK_SPEAKER_SETUP_0_1 ( AK_SPEAKER_LOW_FREQUENCY ) //0.1
180 
181 #define AK_SPEAKER_SETUP_1_0_CENTER ( AK_SPEAKER_FRONT_CENTER ) //1.0 (C)
182 #define AK_SPEAKER_SETUP_1_1_CENTER ( AK_SPEAKER_FRONT_CENTER | AK_SPEAKER_LOW_FREQUENCY ) //1.1 (C)
183 
184 #define AK_SPEAKER_SETUP_2_0 ( AK_SPEAKER_FRONT_LEFT | AK_SPEAKER_FRONT_RIGHT ) //2.0
185 #define AK_SPEAKER_SETUP_2_1 ( AK_SPEAKER_FRONT_LEFT | AK_SPEAKER_FRONT_RIGHT | AK_SPEAKER_LOW_FREQUENCY ) //2.1
186 
187 #define AK_SPEAKER_SETUP_3_0 ( AK_SPEAKER_FRONT_LEFT | AK_SPEAKER_FRONT_RIGHT | AK_SPEAKER_FRONT_CENTER ) //3.0
188 #define AK_SPEAKER_SETUP_3_1 ( AK_SPEAKER_SETUP_3_0 | AK_SPEAKER_LOW_FREQUENCY ) //3.1
189 
190 #define AK_SPEAKER_SETUP_FRONT ( AK_SPEAKER_SETUP_3_0 )
191 
192 #define AK_SPEAKER_SETUP_4_0 ( AK_SPEAKER_SETUP_4 )
193 #define AK_SPEAKER_SETUP_4_1 ( AK_SPEAKER_SETUP_4POINT1 )
194 #define AK_SPEAKER_SETUP_5_0 ( AK_SPEAKER_SETUP_5 )
195 #define AK_SPEAKER_SETUP_5_1 ( AK_SPEAKER_SETUP_5POINT1 )
196 
197 #define AK_SPEAKER_SETUP_6_0 ( AK_SPEAKER_SETUP_6 )
198 #define AK_SPEAKER_SETUP_6_1 ( AK_SPEAKER_SETUP_6POINT1 )
199 #define AK_SPEAKER_SETUP_7_0 ( AK_SPEAKER_SETUP_7 )
200 #define AK_SPEAKER_SETUP_7_1 ( AK_SPEAKER_SETUP_7POINT1 )
201 
202 // Standard/largest setup definitions.
203 #define AK_SPEAKER_SETUP_DEFAULT_PLANE (AK_SPEAKER_SETUP_7POINT1) ///< All speakers on the plane, supported on this platform.
204 #define AK_SUPPORTED_STANDARD_CHANNEL_MASK (AK_SPEAKER_SETUP_ALL_SPEAKERS) ///< Platform supports all standard channels.
205 #define AK_STANDARD_MAX_NUM_CHANNELS (8) ///< Legacy: Platform supports at least 7.1
206 
207 #define AK_MAX_AMBISONICS_ORDER (5)
208 
209 // Helpers.
210 inline void AK_SPEAKER_SETUP_FIX_LEFT_TO_CENTER( AkUInt32 &io_uChannelMask )
211 {
212  if( !(io_uChannelMask & AK_SPEAKER_FRONT_CENTER)
213  && !(io_uChannelMask & AK_SPEAKER_FRONT_RIGHT)
214  && (io_uChannelMask & AK_SPEAKER_FRONT_LEFT) )
215  {
216  io_uChannelMask &= ~AK_SPEAKER_FRONT_LEFT; // remove left
217  io_uChannelMask |= AK_SPEAKER_FRONT_CENTER; // add center
218  }
219 }
220 
221 inline void AK_SPEAKER_SETUP_FIX_REAR_TO_SIDE( AkUInt32 &io_uChannelMask )
222 {
223  if( io_uChannelMask & ( AK_SPEAKER_BACK_LEFT ) && !( io_uChannelMask & AK_SPEAKER_SIDE_LEFT ) )
224  {
225  io_uChannelMask &= ~( AK_SPEAKER_BACK_LEFT | AK_SPEAKER_BACK_RIGHT ); // remove rears
226  io_uChannelMask |= ( AK_SPEAKER_SIDE_LEFT | AK_SPEAKER_SIDE_RIGHT ); // add sides
227  }
228 }
229 
230 inline void AK_SPEAKER_SETUP_CONVERT_TO_SUPPORTED( AkUInt32 &io_uChannelMask )
231 {
232  AK_SPEAKER_SETUP_FIX_LEFT_TO_CENTER( io_uChannelMask );
233  AK_SPEAKER_SETUP_FIX_REAR_TO_SIDE( io_uChannelMask );
234 }
235 
236 /// Ambisonics configurations (corresponding to AkChannelConfig::eConfigType == AK_ChannelConfigType_Ambisonic).
237 /// Convention: X points towards the front, and XYZ follow a right-hand rule, so Y is the side vector (pointing to the left).
238 /// Channel presence and ordering are predefined according to the number of channels. The ordering convention is ACN,
239 /// with the mapping of components to number of channels detailed below (source: https://en.wikipedia.org/wiki/Ambisonic_data_exchange_formats).
240 /// Normalization natively used in Wwise is SN3D.
241 ///
242 /// <table cellspacing="0" cellpadding="1" border="1" width="800px">
243 /// <tr><td rowspan="2" align="center"><b>Number of channels</b></td> <td colspan="2" align="center"><b>Order</b></td><td rowspan="2" align="center"><b>Description</b></td><td rowspan="2" align="center"><b>Layout of components</b></td></tr>
244 /// <tr><td align="center">Horizontal</td><td align="center">Vertical</td></tr>
245 /// <tr><td align="right">1 &nbsp;&nbsp;&nbsp;</td> <td align="right">0 &nbsp;&nbsp;&nbsp;</td><td align="right">0 &nbsp;&nbsp;&nbsp;</td> <td>&nbsp;&nbsp;mono</td><td>&nbsp;</td></tr>
246 /// <tr><td align="right">4 &nbsp;&nbsp;&nbsp;</td> <td align="right">1 &nbsp;&nbsp;&nbsp;</td><td align="right">1 &nbsp;&nbsp;&nbsp;</td> <td>&nbsp;&nbsp;first-order full sphere</td><td>&nbsp;&nbsp;WYZX</td></tr>
247 /// <tr><td align="right">9 &nbsp;&nbsp;&nbsp;</td> <td align="right">2 &nbsp;&nbsp;&nbsp;</td><td align="right">2 &nbsp;&nbsp;&nbsp;</td> <td>&nbsp;&nbsp;second-order full sphere</td><td>&nbsp;&nbsp;WYZXVTRSU</td></tr>
248 /// <tr><td align="right">16 &nbsp;&nbsp;&nbsp;</td> <td align="right">3 &nbsp;&nbsp;&nbsp;</td><td align="right">3 &nbsp;&nbsp;&nbsp;</td> <td>&nbsp;&nbsp;third-order full sphere</td><td>&nbsp;&nbsp;WYZXVTRSUQOMKLNP</td></tr>
249 /// </table>
250 
251 namespace AK
252 {
253 
254 /// Returns the number of channels of a given channel configuration.
255 static inline AkUInt8 ChannelMaskToNumChannels( AkChannelMask in_uChannelMask )
256 {
257  AkUInt8 num = 0;
258  while( in_uChannelMask ){ ++num; in_uChannelMask &= in_uChannelMask-1; } // iterate max once per channel.
259  return num;
260 }
261 
262 /// Returns a 'best guess' channel configuration from a given number of channels.
263 /// Will return 0 if no guess can be made.
264 static inline AkChannelMask ChannelMaskFromNumChannels( unsigned int in_uNumChannels )
265 {
266  AkChannelMask uChannelMask = 0;
267 
268  switch ( in_uNumChannels )
269  {
270  case 1:
271  uChannelMask = AK_SPEAKER_SETUP_1_0_CENTER;
272  break;
273  case 2:
274  uChannelMask = AK_SPEAKER_SETUP_2_0;
275  break;
276  case 3:
277  uChannelMask = AK_SPEAKER_SETUP_2_1;
278  break;
279  case 4:
280  uChannelMask = AK_SPEAKER_SETUP_4_0;
281  break;
282  case 5:
283  uChannelMask = AK_SPEAKER_SETUP_5_0;
284  break;
285  case 6:
286  uChannelMask = AK_SPEAKER_SETUP_5_1;
287  break;
288  case 7:
289  uChannelMask = AK_SPEAKER_SETUP_7;
290  break;
291  case 8:
292  uChannelMask = AK_SPEAKER_SETUP_7POINT1;
293  break;
294  }
295 
296  return uChannelMask;
297 }
298 
299 /// Converts a channel bit to a channel index (in Wwise pipeline ordering - LFE at the end), given a channel mask in_uChannelMask.
300 /// \return Channel index.
301 static inline AkUInt8 ChannelBitToIndex(AkChannelMask in_uChannelBit, AkChannelMask in_uChannelMask)
302 {
303 #ifdef AKASSERT
304  AKASSERT(ChannelMaskToNumChannels(in_uChannelBit) == 1);
305 #endif
306  if (in_uChannelBit == AK_SPEAKER_LOW_FREQUENCY)
307  return ChannelMaskToNumChannels(in_uChannelMask) - 1;
308  return ChannelMaskToNumChannels(in_uChannelMask & ~AK_SPEAKER_LOW_FREQUENCY & (in_uChannelBit - 1)); // Count all channels prior this one except the LFE
309 }
310 
311 /// Returns true when the LFE channel is present in a given channel configuration.
312 /// \return True if the LFE channel is present.
313 AkForceInline bool HasLFE(AkChannelMask in_uChannelMask)
314 {
315  return (in_uChannelMask & AK_SPEAKER_LOW_FREQUENCY) > 0;
316 }
317 
318 /// Returns true when the center channel is present in a given channel configuration.
319 /// Note that mono configurations have one channel which is arbitrary set to AK_SPEAKER_FRONT_CENTER,
320 /// so HasCenter() returns true for mono signals.
321 /// \return True if the center channel is present.
322 AkForceInline bool HasCenter(AkChannelMask in_uChannelMask)
323 {
324  // All supported non-mono configurations have an AK_SPEAKER_FRONT_LEFT.
325  return (in_uChannelMask & AK_SPEAKER_FRONT_CENTER) > 0;
326 }
327 
328 /// Returns the number of angle values required to represent the given channel configuration.
329 /// Use this function with supported 2D standard channel configurations only.
330 /// \sa AK::SoundEngine::SetSpeakerAngles().
332 {
333 #ifdef AKASSERT
334  AKASSERT((in_uChannelMask & ~AK_SPEAKER_SETUP_DEFAULT_PLANE) == 0);
335 #endif
336 
337  // LFE is irrelevant.
338  in_uChannelMask &= ~AK_SPEAKER_LOW_FREQUENCY;
339  // Center speaker is always in the center and thus does not require an angle.
340  in_uChannelMask &= ~AK_SPEAKER_FRONT_CENTER;
341  // We should have complete pairs at this point, unless there is a speaker at 180 degrees,
342  // in which case we need one more angle to specify it.
343 #ifdef AKASSERT
344  AKASSERT((in_uChannelMask & AK_SPEAKER_BACK_CENTER) || ((ChannelMaskToNumChannels(in_uChannelMask) % 2) == 0));
345 #endif
346  return ChannelMaskToNumChannels(in_uChannelMask) >> 1;
347 }
348 
349 /// Channel ordering type.
351 {
352  ChannelOrdering_Standard, // L-R-C-LFE-RL-RR-RC-SL-SR-HL-HR-HC-HRL-HRR-HRC-T
353  ChannelOrdering_RunTime // L-R-C-RL-RR-RC-SL-SR-HL-HR-HC-HRL-HRR-HRC-T-LFE
354 };
355 
356 /// Returns true if standard configuration represented by channel mask has surround
357 /// channels, either defined as side or back channels.
359 {
360  return ( in_uChannelMask & AK_SPEAKER_BACK_LEFT || in_uChannelMask & AK_SPEAKER_SIDE_LEFT );
361 }
362 
363 /// Returns true if standard configuration represented by channel mask has strictly one
364 /// pair of surround channels, either defined as side or back channels. 7.1 has two pairs
365 /// of surround channels and would thus return false.
367 {
368  return ( ( ( in_uChannelMask & AK_SPEAKER_BACK_LEFT ) != 0 ) ^ ( ( in_uChannelMask & AK_SPEAKER_SIDE_LEFT ) != 0 ) );
369 }
370 
371 /// Returns true if standard configuration represented by channel mask has two
372 /// pair of surround channels, that is, side and back channels. 7.1 has two pairs
373 /// of surround channels and would thus return true, whereas 5.1 would return false.
375 {
376  return ( in_uChannelMask & AK_SPEAKER_BACK_LEFT && in_uChannelMask & AK_SPEAKER_SIDE_LEFT );
377 }
378 
379 /// Returns true if standard configuration represented by channel mask has at least one "height" channel (above the plane).
381 {
382  return (in_uChannelMask & ~AK_SPEAKER_SETUP_DEFAULT_PLANE) > 0;
383 }
384 
385 /// Takes a channel mask and swap back channels with side channels if there is just
386 /// one pair of surround channels.
388 {
389  if ( HasStrictlyOnePairOfSurroundChannels( in_uChannelMask ) )
390  {
391  in_uChannelMask &= ~( AK_SPEAKER_BACK_LEFT | AK_SPEAKER_BACK_RIGHT ); // remove rears
392  in_uChannelMask |= ( AK_SPEAKER_SIDE_LEFT | AK_SPEAKER_SIDE_RIGHT ); // add sides
393  }
394  return in_uChannelMask;
395 }
396 
397 /// Convert channel indices as they are ordered in standard (WAV) or Wwise sound engine (WEM) wave files
398 /// (which follow channel mask bit values, except that the LFE is at the end in the case of WEMs)
399 /// into display indices. Desired display order is L-R-C-SL-SR-RL-RR-HL-HR-HC-HRL-HRR-HRC-T-LFE. Note that 4-5.x configurations
400 /// may define back or side channels. Either way they are "Surround" channels and are assigned to "SL, SR" names.
401 static inline unsigned int StdChannelIndexToDisplayIndex( AkChannelOrdering in_eOrdering, unsigned int in_uChannelMask, unsigned int in_uChannelIdx )
402 {
403  if ( in_eOrdering == ChannelOrdering_Standard )
404  {
405  unsigned int uNumChannelsFront = ChannelMaskToNumChannels( in_uChannelMask & AK_SPEAKER_SETUP_FRONT );
406  if ( ( in_uChannelMask & AK_SPEAKER_LOW_FREQUENCY )
407  && ( in_uChannelIdx == uNumChannelsFront ) )
408  {
409  // Lfe. Return penultimate channel.
410  in_uChannelIdx = ChannelMaskToNumChannels( in_uChannelMask ) - 1;
411  }
412  else if ( in_uChannelIdx >= uNumChannelsFront ) // strictly greater than uNumChannelsFront (lfe index) if lfe is present, greater or equal otherwise.
413  {
414  // Back channel. Return index or index-1 if there is an LFE (uLfeOffset==1).
415  unsigned int uLfeOffset = ( in_uChannelMask & AK_SPEAKER_LOW_FREQUENCY ) ? 1 : 0;
416 
417  // 6-7.x: Need to swap back and sides.
418  if ( HasSideAndRearChannels( in_uChannelMask ) )
419  {
420  unsigned int uRearIdx = uNumChannelsFront + uLfeOffset;
421  unsigned int uSideIdx = uRearIdx + 2;
422  unsigned int uAfterSideIdx = uSideIdx + 2;
423  if ( in_uChannelIdx < uAfterSideIdx )
424  {
425  if ( in_uChannelIdx >= uSideIdx )
426  in_uChannelIdx -= 2; // input is side, swap it with back.
427  else
428  in_uChannelIdx += 2; // input is back, swap it with side.
429  }
430  }
431  in_uChannelIdx -= uLfeOffset; // compensate for LFE if it was skipped above.
432  }
433  }
434  else
435  {
436  // 6-7.x: Need to swap back and sides.
437  if ( HasSideAndRearChannels( in_uChannelMask ) )
438  {
439  unsigned int uRearIdx = ChannelMaskToNumChannels( in_uChannelMask & AK_SPEAKER_SETUP_FRONT );
440  unsigned int uMaxIdx = uRearIdx + 4; // Side and rear channels.
441 
442  if ( in_uChannelIdx >= uRearIdx
443  && in_uChannelIdx < uMaxIdx )
444  {
445  // Surround channel (not LFE).
446  unsigned int uSideIdx = uRearIdx + 2;
447  if ( in_uChannelIdx >= uSideIdx )
448  in_uChannelIdx -= 2; // input is side, swap it with back.
449  else
450  in_uChannelIdx += 2; // input is back, swap it with side.
451  }
452  }
453  }
454 
455  return in_uChannelIdx;
456 }
457 
458 } // namespace AK
459 
460 /// Channel configuration type.
462 {
463  AK_ChannelConfigType_Anonymous = 0x0, ///< Channel mask == 0 and channels are anonymous.
464  AK_ChannelConfigType_Standard = 0x1, ///< Channels must be identified with standard defines in AkSpeakerConfigs.
465  AK_ChannelConfigType_Ambisonic = 0x2, ///< Ambisonics. Channel mask == 0 and channels follow standard ambisonic order.
466  AK_ChannelConfigType_Objects = 0x3, ///< Object-based configurations.
467 
468  AK_ChannelConfigType_UseDeviceMain = 0xE, ///< Special setting for bus objects to use the audio device main configuration.
469  AK_ChannelConfigType_UseDevicePassthrough = 0xF ///< Special setting for bus objects to use the audio device passthrough configuration.
470 };
471 
472 /// Defines a channel configuration.
473 /// Examples:
474 /// \code
475 /// AkChannelConfig cfg;
476 ///
477 /// // Create a stereo configuration.
478 /// cfg.SetStandard(AK_SPEAKER_SETUP_STEREO);
479 ///
480 /// // Create a 7.1.4 configuration (7.1 plus 4 height channels).
481 /// cfg.SetStandard(AK_SPEAKER_SETUP_AURO_11POINT1_740);
482 /// // or
483 /// cfg.SetStandard(AK_SPEAKER_SETUP_DOLBY_7_1_4);
484 ///
485 /// // Create a 3rd order ambisonic configuration.
486 /// cfg.SetAmbisonic(16); // pass in the number of spherical harmonics, (N+1)^2, where N is the ambisonics order.
487 ///
488 /// // Invalidate (usually means "As Parent")
489 /// cfg.Clear();
490 /// \endcode
492 {
493  // Channel config:
494  // - uChannelMask is a bit field, whose channel identifiers depend on AkChannelConfigType (up to 20). Channel bits are defined in AkSpeakerConfig.h.
495  // - eConfigType is a code that completes the identification of channels by uChannelMask.
496  // - uNumChannels is the number of channels, identified (deduced from channel mask) or anonymous (set directly).
497  AkUInt32 uNumChannels : 8; ///< Number of channels.
498  AkUInt32 eConfigType : 4; ///< Channel config type (AkChannelConfigType).
499  AkUInt32 uChannelMask : 20;///< Channel mask (configuration).
500 
501  /// Construct standard channel config from channel mask
503  {
504  return AkChannelConfig(AK::ChannelMaskToNumChannels(in_uChannelMask), in_uChannelMask);
505  }
506 
507  // Construct anonymous channel config from number of channels
509  {
510  return AkChannelConfig(in_uNumChannels, 0);
511  }
512 
513  /// Construct ambisonic channel config from number of channels (NOT order)
515  {
516  AkChannelConfig cfg;
517  cfg.SetAmbisonic(in_uNumChannels);
518  return cfg;
519  }
520 
521  // Construct object-based channel config
523  {
524  AkChannelConfig cfg;
525  cfg.SetObject();
526  return cfg;
527  }
528 
529  /// Constructor. Clears / sets the channel config in "invalid" state (IsValid() returns false).
531  : uNumChannels(0)
532  , eConfigType(0)
533  , uChannelMask(0)
534  {
535  }
536 
537  /// Constructor. Sets number of channels, and config type according to whether channel mask is defined or not. If defined, it must be consistent with the number of channels.
538  AkForceInline AkChannelConfig(AkUInt32 in_uNumChannels, AkUInt32 in_uChannelMask)
539  {
540  // Input arguments should be consistent.
541  SetStandardOrAnonymous(in_uNumChannels, in_uChannelMask);
542  }
543 
544  /// Operator != with a 32-bit word.
545  AkForceInline bool operator!=(AkUInt32 in_uBitField)
546  {
547  return (*((AkUInt32*)this) != in_uBitField);
548  }
549 
550  /// Clear the channel config. Becomes "invalid" (IsValid() returns false).
552  {
553  uNumChannels = 0;
554  eConfigType = 0;
555  uChannelMask = 0;
556  }
557 
558  /// Set channel config as a standard configuration specified with given channel mask.
559  AkForceInline void SetStandard(AkUInt32 in_uChannelMask)
560  {
561  uNumChannels = AK::ChannelMaskToNumChannels(in_uChannelMask);
563  uChannelMask = in_uChannelMask;
564  }
565 
566  /// Set channel config as either a standard or an anonymous configuration, specified with both a given channel mask (0 if anonymous) and a number of channels (which must match the channel mask if standard).
567  AkForceInline void SetStandardOrAnonymous(AkUInt32 in_uNumChannels, AkUInt32 in_uChannelMask)
568  {
569 #ifdef AKASSERT
570  AKASSERT(in_uChannelMask == 0 || in_uNumChannels == AK::ChannelMaskToNumChannels(in_uChannelMask));
571 #endif
572  uNumChannels = in_uNumChannels;
574  uChannelMask = in_uChannelMask;
575  }
576 
577  /// Set channel config as an anonymous configuration specified with given number of channels.
578  AkForceInline void SetAnonymous(AkUInt32 in_uNumChannels)
579  {
580  uNumChannels = in_uNumChannels;
582  uChannelMask = 0;
583  }
584 
585  /// Set channel config as an ambisonic configuration specified with given number of channels.
586  AkForceInline void SetAmbisonic(AkUInt32 in_uNumChannels)
587  {
588  uNumChannels = in_uNumChannels;
590  uChannelMask = 0;
591  }
592 
593  /// Set channel config as an object-based configuration (implies dynamic number of objects).
595  {
596  uNumChannels = 0;
598  uChannelMask = 0;
599  }
600 
601  /// Set channel config as the main mix channel configuration
603  {
604  uNumChannels = 0;
606  uChannelMask = 0;
607  }
608 
609  /// Set channel config as the passthrough mix channel configuration
611  {
612  uNumChannels = 0;
614  uChannelMask = 0;
615  }
616 
617  /// Returns true if valid, false otherwise (as when it is constructed, or invalidated using Clear()).
618  AkForceInline bool IsValid() const
619  {
621  }
622 
623  /// Serialize channel config into a 32-bit word.
625  {
626  return uNumChannels | (eConfigType << 8) | (uChannelMask << 12);
627  }
628 
629  /// Deserialize channel config from a 32-bit word.
630  AkForceInline void Deserialize(AkUInt32 in_uChannelConfig)
631  {
632  uNumChannels = in_uChannelConfig & 0x000000ff;
633  eConfigType = (in_uChannelConfig >> 8) & 0x0000000f;
634  uChannelMask = (in_uChannelConfig >> 12) & 0x000fffff;
635  }
636 
637  /// Returns a new config based on 'this' with no LFE.
639  {
640  AkChannelConfig newConfig = *this;
641  AkUInt32 uNewChannelMask = newConfig.uChannelMask & ~AK_SPEAKER_LOW_FREQUENCY;
642  AkUInt32 uNumLFEChannel = (newConfig.uChannelMask - uNewChannelMask) >> 3; // 0 or 1
643 #ifdef AKASSERT
644  AKASSERT(uNumLFEChannel == 0 || uNumLFEChannel == 1);
645 #endif
646  newConfig.uNumChannels -= uNumLFEChannel;
647  newConfig.uChannelMask = uNewChannelMask;
648  return newConfig;
649  }
650 
651  /// Returns a new config based on 'this' with no Front Center channel.
653  {
654  AkChannelConfig newConfig = *this;
655  AkUInt32 uNewChannelMask = newConfig.uChannelMask & ~AK_SPEAKER_FRONT_CENTER;
656  AkUInt32 uNumCenterChannel = (newConfig.uChannelMask - uNewChannelMask) >> 2; // 0 or 1.
657 #ifdef AKASSERT
658  AKASSERT(uNumCenterChannel == 0 || uNumCenterChannel == 1);
659 #endif
660  newConfig.uNumChannels -= uNumCenterChannel;
661  newConfig.uChannelMask = uNewChannelMask;
662  return newConfig;
663  }
664 
665  /// Operator ==
666  AkForceInline bool operator==(const AkChannelConfig & in_other) const
667  {
668  return uNumChannels == in_other.uNumChannels
669  && eConfigType == in_other.eConfigType
670  && uChannelMask == in_other.uChannelMask;
671  }
672 
673  /// Operator !=
674  AkForceInline bool operator!=(const AkChannelConfig & in_other) const
675  {
676  return uNumChannels != in_other.uNumChannels
677  || eConfigType != in_other.eConfigType
678  || uChannelMask != in_other.uChannelMask;
679  }
680 
681  /// Query if LFE channel is present.
682  /// \return True when LFE channel is present
683  AkForceInline bool HasLFE() const
684  {
685  return AK::HasLFE(uChannelMask);
686  }
687 
688  /// Query if center channel is present.
689  /// Note that mono configurations have one channel which is arbitrary set to AK_SPEAKER_FRONT_CENTER,
690  /// so HasCenter() returns true for mono signals.
691  /// \return True when center channel is present and configuration has more than 2 channels.
692  AkForceInline bool HasCenter() const
693  {
694  return AK::HasCenter(uChannelMask);
695  }
696 };
697 
698 #endif //_AK_SPEAKERCONFIG_H_
AkForceInline bool operator!=(AkUInt32 in_uBitField)
Operator != with a 32-bit word.
Definition: AkSpeakerConfig.h:545
AkForceInline bool HasLFE(AkChannelMask in_uChannelMask)
Definition: AkSpeakerConfig.h:313
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...
Definition: AkSpeakerConfig.h:567
static AkForceInline AkChannelConfig Ambisonic(AkUInt32 in_uNumChannels)
Construct ambisonic channel config from number of channels (NOT order)
Definition: AkSpeakerConfig.h:514
#define AK_SPEAKER_SETUP_5_0
Definition: AkSpeakerConfig.h:194
Audiokinetic namespace.
AkForceInline bool HasCenter() const
Definition: AkSpeakerConfig.h:692
AkForceInline AkChannelMask BackToSideChannels(AkChannelMask in_uChannelMask)
Definition: AkSpeakerConfig.h:387
AkUInt32 uNumChannels
Number of channels.
Definition: AkSpeakerConfig.h:497
void AK_SPEAKER_SETUP_FIX_REAR_TO_SIDE(AkUInt32 &io_uChannelMask)
Definition: AkSpeakerConfig.h:221
#define AK_SPEAKER_SETUP_1_0_CENTER
Definition: AkSpeakerConfig.h:181
AkUInt32 uChannelMask
Channel mask (configuration).
Definition: AkSpeakerConfig.h:499
@ ChannelOrdering_Standard
Definition: AkSpeakerConfig.h:352
@ AK_ChannelConfigType_Standard
Channels must be identified with standard defines in AkSpeakerConfigs.
Definition: AkSpeakerConfig.h:464
AkForceInline bool HasCenter(AkChannelMask in_uChannelMask)
Definition: AkSpeakerConfig.h:322
#define AK_SPEAKER_SETUP_7POINT1
7.1 setup channel mask
Definition: AkSpeakerConfig.h:70
#define AK_SPEAKER_BACK_LEFT
Rear left speaker bit mask.
Definition: AkSpeakerConfig.h:37
AkUInt32 AkChannelMask
Channel mask (similar to WAVE_FORMAT_EXTENSIBLE). Bit values are defined in AkSpeakerConfig....
Definition: AkTypes.h:149
uint8_t AkUInt8
Unsigned 8-bit integer.
Definition: AkNumeralTypes.h:36
AkForceInline AkChannelConfig()
Constructor. Clears / sets the channel config in "invalid" state (IsValid() returns false).
Definition: AkSpeakerConfig.h:530
AkForceInline void SetAmbisonic(AkUInt32 in_uNumChannels)
Set channel config as an ambisonic configuration specified with given number of channels.
Definition: AkSpeakerConfig.h:586
@ AK_ChannelConfigType_Objects
Object-based configurations.
Definition: AkSpeakerConfig.h:466
#define AK_SPEAKER_FRONT_RIGHT
Front right speaker bit mask.
Definition: AkSpeakerConfig.h:34
AkForceInline AkUInt32 Serialize() const
Serialize channel config into a 32-bit word.
Definition: AkSpeakerConfig.h:624
@ AK_ChannelConfigType_Ambisonic
Ambisonics. Channel mask == 0 and channels follow standard ambisonic order.
Definition: AkSpeakerConfig.h:465
static unsigned int StdChannelIndexToDisplayIndex(AkChannelOrdering in_eOrdering, unsigned int in_uChannelMask, unsigned int in_uChannelIdx)
Definition: AkSpeakerConfig.h:401
AkForceInline void SetSameAsPassthrough()
Set channel config as the passthrough mix channel configuration.
Definition: AkSpeakerConfig.h:610
AkForceInline void SetAnonymous(AkUInt32 in_uNumChannels)
Set channel config as an anonymous configuration specified with given number of channels.
Definition: AkSpeakerConfig.h:578
AkForceInline AkChannelConfig RemoveCenter() const
Returns a new config based on 'this' with no Front Center channel.
Definition: AkSpeakerConfig.h:652
static AkUInt8 ChannelBitToIndex(AkChannelMask in_uChannelBit, AkChannelMask in_uChannelMask)
Definition: AkSpeakerConfig.h:301
#define AK_SPEAKER_SETUP_DEFAULT_PLANE
All speakers on the plane, supported on this platform.
Definition: AkSpeakerConfig.h:203
AkForceInline bool operator!=(const AkChannelConfig &in_other) const
Operator !=.
Definition: AkSpeakerConfig.h:674
@ AK_ChannelConfigType_UseDevicePassthrough
Special setting for bus objects to use the audio device passthrough configuration.
Definition: AkSpeakerConfig.h:469
AkForceInline AkUInt32 GetNumberOfAnglesForConfig(AkChannelMask in_uChannelMask)
Definition: AkSpeakerConfig.h:331
static AkForceInline AkChannelConfig Anonymous(AkUInt32 in_uNumChannels)
Definition: AkSpeakerConfig.h:508
#define AK_SPEAKER_SIDE_LEFT
Side left speaker bit mask.
Definition: AkSpeakerConfig.h:40
#define AKASSERT(Condition)
Definition: AkAssert.h:67
#define AK_SPEAKER_BACK_CENTER
Rear center speaker ("surround speaker") bit mask.
Definition: AkSpeakerConfig.h:39
static AkChannelMask ChannelMaskFromNumChannels(unsigned int in_uNumChannels)
Definition: AkSpeakerConfig.h:264
AkForceInline void Clear()
Clear the channel config. Becomes "invalid" (IsValid() returns false).
Definition: AkSpeakerConfig.h:551
AkForceInline void SetSameAsMainMix()
Set channel config as the main mix channel configuration.
Definition: AkSpeakerConfig.h:602
#define AK_SPEAKER_SETUP_5_1
Definition: AkSpeakerConfig.h:195
AkChannelConfigType
Channel configuration type.
Definition: AkSpeakerConfig.h:462
AkForceInline bool HasHeightChannels(AkChannelMask in_uChannelMask)
Returns true if standard configuration represented by channel mask has at least one "height" channel ...
Definition: AkSpeakerConfig.h:380
#define AK_SPEAKER_SETUP_FRONT
Definition: AkSpeakerConfig.h:190
static AkForceInline AkChannelConfig Object()
Definition: AkSpeakerConfig.h:522
#define AK_SPEAKER_SETUP_7
7.0 setup channel mask
Definition: AkSpeakerConfig.h:69
AkForceInline void SetObject()
Set channel config as an object-based configuration (implies dynamic number of objects).
Definition: AkSpeakerConfig.h:594
#define AK_SPEAKER_SETUP_2_1
Definition: AkSpeakerConfig.h:185
@ AK_ChannelConfigType_Anonymous
Channel mask == 0 and channels are anonymous.
Definition: AkSpeakerConfig.h:463
AkForceInline bool HasSurroundChannels(AkChannelMask in_uChannelMask)
Definition: AkSpeakerConfig.h:358
#define AK_SPEAKER_SETUP_2_0
Definition: AkSpeakerConfig.h:184
AkForceInline bool operator==(const AkChannelConfig &in_other) const
Operator ==.
Definition: AkSpeakerConfig.h:666
AkForceInline AkChannelConfig RemoveLFE() const
Returns a new config based on 'this' with no LFE.
Definition: AkSpeakerConfig.h:638
AkForceInline void SetStandard(AkUInt32 in_uChannelMask)
Set channel config as a standard configuration specified with given channel mask.
Definition: AkSpeakerConfig.h:559
#define AK_SPEAKER_FRONT_LEFT
Standard speakers (channel mask):
Definition: AkSpeakerConfig.h:33
AkForceInline AkChannelConfig(AkUInt32 in_uNumChannels, AkUInt32 in_uChannelMask)
Constructor. Sets number of channels, and config type according to whether channel mask is defined or...
Definition: AkSpeakerConfig.h:538
uint32_t AkUInt32
Unsigned 32-bit integer.
Definition: AkNumeralTypes.h:38
AkUInt32 eConfigType
Channel config type (AkChannelConfigType).
Definition: AkSpeakerConfig.h:498
@ AK_ChannelConfigType_UseDeviceMain
Special setting for bus objects to use the audio device main configuration.
Definition: AkSpeakerConfig.h:468
AkForceInline bool HasSideAndRearChannels(AkChannelMask in_uChannelMask)
Definition: AkSpeakerConfig.h:374
AkForceInline bool HasLFE() const
Definition: AkSpeakerConfig.h:683
static AkUInt8 ChannelMaskToNumChannels(AkChannelMask in_uChannelMask)
Returns the number of channels of a given channel configuration.
Definition: AkSpeakerConfig.h:255
void AK_SPEAKER_SETUP_CONVERT_TO_SUPPORTED(AkUInt32 &io_uChannelMask)
Definition: AkSpeakerConfig.h:230
AkChannelOrdering
Channel ordering type.
Definition: AkSpeakerConfig.h:351
#define AK_SPEAKER_LOW_FREQUENCY
Low-frequency speaker bit mask.
Definition: AkSpeakerConfig.h:36
AkForceInline void Deserialize(AkUInt32 in_uChannelConfig)
Deserialize channel config from a 32-bit word.
Definition: AkSpeakerConfig.h:630
#define AK_SPEAKER_FRONT_CENTER
Front center speaker bit mask.
Definition: AkSpeakerConfig.h:35
#define AkForceInline
Definition: AkTypes.h:61
void AK_SPEAKER_SETUP_FIX_LEFT_TO_CENTER(AkUInt32 &io_uChannelMask)
Definition: AkSpeakerConfig.h:210
@ ChannelOrdering_RunTime
Definition: AkSpeakerConfig.h:353
static AkForceInline AkChannelConfig Standard(AkUInt32 in_uChannelMask)
Construct standard channel config from channel mask.
Definition: AkSpeakerConfig.h:502
AkForceInline bool IsValid() const
Returns true if valid, false otherwise (as when it is constructed, or invalidated using Clear()).
Definition: AkSpeakerConfig.h:618
#define AK_SPEAKER_SETUP_4_0
Definition: AkSpeakerConfig.h:192
#define AK_SPEAKER_BACK_RIGHT
Rear right speaker bit mask.
Definition: AkSpeakerConfig.h:38
#define AK_SPEAKER_SIDE_RIGHT
Side right speaker bit mask.
Definition: AkSpeakerConfig.h:41
AkForceInline bool HasStrictlyOnePairOfSurroundChannels(AkChannelMask in_uChannelMask)
Definition: AkSpeakerConfig.h:366

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

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