版本

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

此页面对您是否有帮助?

需要技术支持?

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

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

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

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

开始 Wwise 之旅