バージョン

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

このページはお役に立ちましたか?

サポートは必要ですか?

ご質問や問題、ご不明点はございますか?お気軽にお問い合わせください。

サポートページをご確認ください

あなたのプロジェクトについて教えてください。ご不明な点はありませんか。

プロジェクトを登録していただくことで、ご利用開始のサポートをいたします。

Wwiseからはじめよう