2 * OpenAL cross platform audio library
3 * Copyright (C) 1999-2010 by authors.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 * Or go to http://www.gnu.org/copyleft/lgpl.html
36 void ComputeAngleGains(const ALCdevice
*device
, ALfloat angle
, ALfloat elevation
, ALfloat ingain
, ALfloat gains
[MAX_OUTPUT_CHANNELS
])
39 sinf(angle
) * cosf(elevation
),
41 -cosf(angle
) * cosf(elevation
)
43 ComputeDirectionalGains(device
, dir
, ingain
, gains
);
46 void ComputeDirectionalGains(const ALCdevice
*device
, const ALfloat dir
[3], ALfloat ingain
, ALfloat gains
[MAX_OUTPUT_CHANNELS
])
48 ALfloat coeffs
[MAX_AMBI_COEFFS
];
50 /* Convert from OpenAL coords to Ambisonics. */
55 coeffs
[0] = 0.7071f
; /* sqrt(1.0 / 2.0) */
56 coeffs
[1] = x
; /* X */
57 coeffs
[2] = y
; /* Y */
58 coeffs
[3] = z
; /* Z */
59 coeffs
[4] = 0.5f
* (3.0f
*z
*z
- 1.0f
); /* 0.5 * (3*Z*Z - 1) */
60 coeffs
[5] = 2.0f
* z
* x
; /* 2*Z*X */
61 coeffs
[6] = 2.0f
* y
* z
; /* 2*Y*Z */
62 coeffs
[7] = x
*x
- y
*y
; /* X*X - Y*Y */
63 coeffs
[8] = 2.0f
* x
* y
; /* 2*X*Y */
64 coeffs
[9] = 0.5f
* z
* (5.0f
*z
*z
- 3.0f
); /* 0.5 * Z * (5*Z*Z - 3) */
65 coeffs
[10] = 0.7262f
* x
* (5.0f
*z
*z
- 1.0f
); /* sqrt(135.0 / 256.0) * X * (5*Z*Z - 1) */
66 coeffs
[11] = 0.7262f
* y
* (5.0f
*z
*z
- 1.0f
); /* sqrt(135.0 / 256.0) * Y * (5*Z*Z - 1) */
67 coeffs
[12] = 2.5981f
* z
* (x
*x
- y
*y
); /* sqrt(27.0 / 4.0) * Z * (X*X - Y*Y) */
68 coeffs
[13] = 5.1962f
* x
* y
* z
; /* sqrt(27) * X * Y * Z */
69 coeffs
[14] = x
* (x
*x
- 3.0f
*y
*y
); /* X * (X*X - 3*Y*Y) */
70 coeffs
[15] = y
* (3.0f
*x
*x
- y
*y
); /* Y * (3*X*X - Y*Y) */
72 for(i
= 0;i
< MAX_OUTPUT_CHANNELS
;i
++)
74 for(i
= 0;i
< device
->NumChannels
;i
++)
76 for(j
= 0;j
< MAX_AMBI_COEFFS
;j
++)
77 gains
[i
] += device
->Channel
[i
].HOACoeff
[j
]*coeffs
[j
];
82 void ComputeAmbientGains(const ALCdevice
*device
, ALfloat ingain
, ALfloat gains
[MAX_OUTPUT_CHANNELS
])
86 for(i
= 0;i
< MAX_OUTPUT_CHANNELS
;i
++)
88 for(i
= 0;i
< device
->NumChannels
;i
++)
90 // The W coefficients are based on a mathematical average of the
91 // output, scaled by sqrt(2) to compensate for FuMa-style Ambisonics
92 // scaling the W channel input by sqrt(0.5). The square root of the
93 // base average provides for a more perceptual average volume, better
94 // suited to non-directional gains.
95 gains
[i
] = sqrtf(device
->Channel
[i
].HOACoeff
[0]/1.4142f
) * ingain
;
99 void ComputeBFormatGains(const ALCdevice
*device
, const ALfloat mtx
[4], ALfloat ingain
, ALfloat gains
[MAX_OUTPUT_CHANNELS
])
103 for(i
= 0;i
< MAX_OUTPUT_CHANNELS
;i
++)
105 for(i
= 0;i
< device
->NumChannels
;i
++)
108 gains
[i
] += device
->Channel
[i
].FOACoeff
[j
] * mtx
[j
];
114 DECL_CONST
static inline const char *GetLabelFromChannel(enum Channel channel
)
118 case FrontLeft
: return "front-left";
119 case FrontRight
: return "front-right";
120 case FrontCenter
: return "front-center";
121 case LFE
: return "lfe";
122 case BackLeft
: return "back-left";
123 case BackRight
: return "back-right";
124 case BackCenter
: return "back-center";
125 case SideLeft
: return "side-left";
126 case SideRight
: return "side-right";
128 case TopFrontLeft
: return "top-front-left";
129 case TopFrontRight
: return "top-front-right";
130 case TopBackLeft
: return "top-back-left";
131 case TopBackRight
: return "top-back-right";
132 case BottomFrontLeft
: return "bottom-front-left";
133 case BottomFrontRight
: return "bottom-front-right";
134 case BottomBackLeft
: return "bottom-back-left";
135 case BottomBackRight
: return "bottom-back-right";
137 case Aux0
: return "aux-0";
138 case Aux1
: return "aux-1";
139 case Aux2
: return "aux-2";
140 case Aux3
: return "aux-3";
142 case InvalidChannel
: break;
148 typedef struct ChannelMap
{
149 enum Channel ChanName
;
150 ChannelConfig Config
;
153 static void SetChannelMap(ALCdevice
*device
, const ChannelMap
*chanmap
, size_t count
)
157 for(i
= 0;i
< MAX_OUTPUT_CHANNELS
&& device
->ChannelName
[i
] != InvalidChannel
;i
++)
159 if(device
->ChannelName
[i
] == LFE
)
161 for(j
= 0;j
< MAX_AMBI_COEFFS
;j
++)
162 device
->Channel
[i
].HOACoeff
[j
] = 0.0f
;
164 device
->Channel
[i
].FOACoeff
[j
] = 0.0f
;
168 for(j
= 0;j
< count
;j
++)
170 if(device
->ChannelName
[i
] == chanmap
[j
].ChanName
)
172 device
->Channel
[i
] = chanmap
[j
].Config
;
177 ERR("Failed to match %s channel ("SZFMT
") in config\n", GetLabelFromChannel(device
->ChannelName
[i
]), i
);
179 device
->NumChannels
= i
;
182 static bool LoadChannelSetup(ALCdevice
*device
)
184 static const enum Channel mono_chans
[1] = {
186 }, stereo_chans
[2] = {
187 FrontLeft
, FrontRight
189 FrontLeft
, FrontRight
,
191 }, surround51_chans
[5] = {
192 FrontLeft
, FrontRight
, FrontCenter
,
194 }, surround51rear_chans
[5] = {
195 FrontLeft
, FrontRight
, FrontCenter
,
197 }, surround61_chans
[6] = {
198 FrontLeft
, FrontRight
,
199 FrontCenter
, BackCenter
,
201 }, surround71_chans
[7] = {
202 FrontLeft
, FrontRight
, FrontCenter
,
206 ChannelMap chanmap
[MAX_OUTPUT_CHANNELS
];
207 const enum Channel
*channels
= NULL
;
208 const char *layout
= NULL
;
212 switch(device
->FmtChans
)
216 channels
= mono_chans
;
217 count
= COUNTOF(mono_chans
);
221 channels
= stereo_chans
;
222 count
= COUNTOF(stereo_chans
);
226 channels
= quad_chans
;
227 count
= COUNTOF(quad_chans
);
230 layout
= "surround51";
231 channels
= surround51_chans
;
232 count
= COUNTOF(surround51_chans
);
235 layout
= "surround51rear";
236 channels
= surround51rear_chans
;
237 count
= COUNTOF(surround51rear_chans
);
240 layout
= "surround61";
241 channels
= surround61_chans
;
242 count
= COUNTOF(surround61_chans
);
245 layout
= "surround71";
246 channels
= surround71_chans
;
247 count
= COUNTOF(surround71_chans
);
249 case DevFmtBFormat3D
:
258 snprintf(name
, sizeof(name
), "%s/enable", layout
);
259 if(!GetConfigValueBool("layouts", name
, 0))
263 for(i
= 0;i
< count
;i
++)
265 const char *channame
;
270 chanmap
[i
].ChanName
= channels
[i
];
271 channame
= GetLabelFromChannel(channels
[i
]);
273 snprintf(chanlayout
, sizeof(chanlayout
), "%s/%s", layout
, channame
);
274 if(!ConfigValueStr("layouts", chanlayout
, &value
))
276 ERR("Missing channel %s\n", channame
);
279 props
= sscanf(value
, " %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f ; %f %f %f %f",
280 &chanmap
[i
].Config
.HOACoeff
[0], &chanmap
[i
].Config
.HOACoeff
[1], &chanmap
[i
].Config
.HOACoeff
[2],
281 &chanmap
[i
].Config
.HOACoeff
[3], &chanmap
[i
].Config
.HOACoeff
[4], &chanmap
[i
].Config
.HOACoeff
[5],
282 &chanmap
[i
].Config
.HOACoeff
[6], &chanmap
[i
].Config
.HOACoeff
[7], &chanmap
[i
].Config
.HOACoeff
[8],
283 &chanmap
[i
].Config
.HOACoeff
[9], &chanmap
[i
].Config
.HOACoeff
[10], &chanmap
[i
].Config
.HOACoeff
[11],
284 &chanmap
[i
].Config
.HOACoeff
[12], &chanmap
[i
].Config
.HOACoeff
[13], &chanmap
[i
].Config
.HOACoeff
[14],
285 &chanmap
[i
].Config
.HOACoeff
[15], &chanmap
[i
].Config
.FOACoeff
[0], &chanmap
[i
].Config
.FOACoeff
[1],
286 &chanmap
[i
].Config
.FOACoeff
[2], &chanmap
[i
].Config
.FOACoeff
[3]);
289 ERR("Failed to parse %s channel's properties\n", channame
);
295 ERR("Failed to parse %s channel's elements (expected 20, got %d)\n", channame
, props
);
299 SetChannelMap(device
, chanmap
, count
);
303 ALvoid
aluInitPanning(ALCdevice
*device
)
305 static const ChannelMap MonoCfg
[1] = {
306 { FrontCenter
, { { 1.4142f
}, { 1.4142f
} } },
308 { FrontLeft
, { { 0.7071f
, 0.0f
, 0.5f
, 0.0f
}, { 0.7071f
, 0.0f
, 0.5f
, 0.0f
} } },
309 { FrontRight
, { { 0.7071f
, 0.0f
, -0.5f
, 0.0f
}, { 0.7071f
, 0.0f
, -0.5f
, 0.0f
} } },
311 { FrontLeft
, { { 0.353558f
, 0.306181f
, 0.306192f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.000000f
, 0.117183f
}, { 0.353553f
, 0.250000f
, 0.250000f
, 0.0f
} } },
312 { FrontRight
, { { 0.353558f
, 0.306181f
, -0.306192f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.000000f
, -0.117183f
}, { 0.353553f
, 0.250000f
, -0.250000f
, 0.0f
} } },
313 { BackLeft
, { { 0.353543f
, -0.306192f
, 0.306181f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.000000f
, -0.117193f
}, { 0.353553f
, -0.250000f
, 0.250000f
, 0.0f
} } },
314 { BackRight
, { { 0.353543f
, -0.306192f
, -0.306181f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.000000f
, 0.117193f
}, { 0.353553f
, -0.250000f
, -0.250000f
, 0.0f
} } },
316 { FrontLeft
, { { 0.208954f
, 0.212846f
, 0.238350f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.017738f
, 0.204014f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.051023f
, 0.047490f
}, { 0.208954f
, 0.162905f
, 0.182425f
, 0.0f
} } },
317 { FrontRight
, { { 0.208954f
, 0.212846f
, -0.238350f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.017738f
, -0.204014f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.051023f
, -0.047490f
}, { 0.208954f
, 0.162905f
, -0.182425f
, 0.0f
} } },
318 { FrontCenter
, { { 0.109403f
, 0.179490f
, 0.000000f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.142031f
, -0.000002f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.072024f
, -0.000001f
}, { 0.109403f
, 0.137375f
, 0.000000f
, 0.0f
} } },
319 { SideLeft
, { { 0.470936f
, -0.369626f
, 0.349386f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.031375f
, -0.058144f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.007119f
, -0.043968f
}, { 0.470934f
, -0.282903f
, 0.267406f
, 0.0f
} } },
320 { SideRight
, { { 0.470936f
, -0.369626f
, -0.349386f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.031375f
, 0.058144f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.007119f
, 0.043968f
}, { 0.470934f
, -0.282903f
, -0.267406f
, 0.0f
} } },
322 { FrontLeft
, { { 0.208954f
, 0.212846f
, 0.238350f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.017738f
, 0.204014f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.051023f
, 0.047490f
}, { 0.208954f
, 0.162905f
, 0.182425f
, 0.0f
} } },
323 { FrontRight
, { { 0.208954f
, 0.212846f
, -0.238350f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.017738f
, -0.204014f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.051023f
, -0.047490f
}, { 0.208954f
, 0.162905f
, -0.182425f
, 0.0f
} } },
324 { FrontCenter
, { { 0.109403f
, 0.179490f
, 0.000000f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.142031f
, -0.000002f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.072024f
, -0.000001f
}, { 0.109403f
, 0.137375f
, 0.000000f
, 0.0f
} } },
325 { BackLeft
, { { 0.470936f
, -0.369626f
, 0.349386f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.031375f
, -0.058144f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.007119f
, -0.043968f
}, { 0.470934f
, -0.282903f
, 0.267406f
, 0.0f
} } },
326 { BackRight
, { { 0.470936f
, -0.369626f
, -0.349386f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.031375f
, 0.058144f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.007119f
, 0.043968f
}, { 0.470934f
, -0.282903f
, -0.267406f
, 0.0f
} } },
328 { FrontLeft
, { { 0.167065f
, 0.200583f
, 0.172695f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.029855f
, 0.186407f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.039241f
, 0.068910f
}, { 0.167065f
, 0.153519f
, 0.132175f
, 0.0f
} } },
329 { FrontRight
, { { 0.167065f
, 0.200583f
, -0.172695f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.029855f
, -0.186407f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.039241f
, -0.068910f
}, { 0.167065f
, 0.153519f
, -0.132175f
, 0.0f
} } },
330 { FrontCenter
, { { 0.109403f
, 0.179490f
, 0.000000f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.142031f
, 0.000000f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.072024f
, -0.000001f
}, { 0.109403f
, 0.137375f
, 0.000000f
, 0.0f
} } },
331 { BackCenter
, { { 0.353556f
, -0.461940f
, 0.000000f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.165723f
, 0.000000f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.000000f
, 0.000005f
}, { 0.353556f
, -0.353554f
, 0.000000f
, 0.0f
} } },
332 { SideLeft
, { { 0.289151f
, -0.081301f
, 0.401292f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.188208f
, -0.071420f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.010099f
, -0.032897f
}, { 0.289151f
, -0.062225f
, 0.307136f
, 0.0f
} } },
333 { SideRight
, { { 0.289151f
, -0.081301f
, -0.401292f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.188208f
, 0.071420f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.010099f
, 0.032897f
}, { 0.289151f
, -0.062225f
, -0.307136f
, 0.0f
} } },
335 { FrontLeft
, { { 0.167065f
, 0.200583f
, 0.172695f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.029855f
, 0.186407f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.039241f
, 0.068910f
}, { 0.167065f
, 0.153519f
, 0.132175f
, 0.0f
} } },
336 { FrontRight
, { { 0.167065f
, 0.200583f
, -0.172695f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.029855f
, -0.186407f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.039241f
, -0.068910f
}, { 0.167065f
, 0.153519f
, -0.132175f
, 0.0f
} } },
337 { FrontCenter
, { { 0.109403f
, 0.179490f
, 0.000000f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.142031f
, 0.000000f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.072024f
, 0.000000f
}, { 0.109403f
, 0.137375f
, 0.000000f
, 0.0f
} } },
338 { BackLeft
, { { 0.224752f
, -0.295009f
, 0.170325f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.105349f
, -0.182473f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.000000f
, 0.065799f
}, { 0.224752f
, -0.225790f
, 0.130361f
, 0.0f
} } },
339 { BackRight
, { { 0.224752f
, -0.295009f
, -0.170325f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.105349f
, 0.182473f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.000000f
, -0.065799f
}, { 0.224752f
, -0.225790f
, -0.130361f
, 0.0f
} } },
340 { SideLeft
, { { 0.224739f
, 0.000002f
, 0.340644f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.210697f
, 0.000002f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.000000f
, -0.065795f
}, { 0.224739f
, 0.000000f
, 0.260717f
, 0.0f
} } },
341 { SideRight
, { { 0.224739f
, 0.000002f
, -0.340644f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, -0.210697f
, -0.000002f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.0f
, 0.000000f
, 0.065795f
}, { 0.224739f
, 0.000000f
, -0.260717f
, 0.0f
} } },
343 { TopFrontLeft
, { { 0.176777f
, 0.125000f
, 0.125000f
, 0.125000f
}, { 0.176777f
, 0.125000f
, 0.125000f
, 0.125000f
} } },
344 { TopFrontRight
, { { 0.176777f
, 0.125000f
, -0.125000f
, 0.125000f
}, { 0.176777f
, 0.125000f
, -0.125000f
, 0.125000f
} } },
345 { TopBackLeft
, { { 0.176777f
, -0.125000f
, 0.125000f
, 0.125000f
}, { 0.176777f
, -0.125000f
, 0.125000f
, 0.125000f
} } },
346 { TopBackRight
, { { 0.176777f
, -0.125000f
, -0.125000f
, 0.125000f
}, { 0.176777f
, -0.125000f
, -0.125000f
, 0.125000f
} } },
347 { BottomFrontLeft
, { { 0.176777f
, 0.125000f
, 0.125000f
, -0.125000f
}, { 0.176777f
, 0.125000f
, 0.125000f
, -0.125000f
} } },
348 { BottomFrontRight
, { { 0.176777f
, 0.125000f
, -0.125000f
, -0.125000f
}, { 0.176777f
, 0.125000f
, -0.125000f
, -0.125000f
} } },
349 { BottomBackLeft
, { { 0.176777f
, -0.125000f
, 0.125000f
, -0.125000f
}, { 0.176777f
, -0.125000f
, 0.125000f
, -0.125000f
} } },
350 { BottomBackRight
, { { 0.176777f
, -0.125000f
, -0.125000f
, -0.125000f
}, { 0.176777f
, -0.125000f
, -0.125000f
, -0.125000f
} } },
352 { Aux0
, { { 1.0f
, 0.0f
, 0.0f
, 0.0f
}, { 1.0f
, 0.0f
, 0.0f
, 0.0f
} } },
353 { Aux1
, { { 0.0f
, 1.0f
, 0.0f
, 0.0f
}, { 0.0f
, 1.0f
, 0.0f
, 0.0f
} } },
354 { Aux2
, { { 0.0f
, 0.0f
, 1.0f
, 0.0f
}, { 0.0f
, 0.0f
, 1.0f
, 0.0f
} } },
355 { Aux3
, { { 0.0f
, 0.0f
, 0.0f
, 1.0f
}, { 0.0f
, 0.0f
, 0.0f
, 1.0f
} } },
357 const ChannelMap
*chanmap
= NULL
;
360 memset(device
->Channel
, 0, sizeof(device
->Channel
));
361 device
->NumChannels
= 0;
365 static const struct {
366 enum Channel channel
;
369 } VirtualChans
[8] = {
370 { TopFrontLeft
, DEG2RAD( 45.0f
), DEG2RAD( -45.0f
) },
371 { TopFrontRight
, DEG2RAD( 45.0f
), DEG2RAD( 45.0f
) },
372 { TopBackLeft
, DEG2RAD( 45.0f
), DEG2RAD(-135.0f
) },
373 { TopBackRight
, DEG2RAD( 45.0f
), DEG2RAD( 135.0f
) },
374 { BottomFrontLeft
, DEG2RAD(-45.0f
), DEG2RAD( -45.0f
) },
375 { BottomFrontRight
, DEG2RAD(-45.0f
), DEG2RAD( 45.0f
) },
376 { BottomBackLeft
, DEG2RAD(-45.0f
), DEG2RAD(-135.0f
) },
377 { BottomBackRight
, DEG2RAD(-45.0f
), DEG2RAD( 135.0f
) },
381 count
= COUNTOF(Cube8
);
384 for(i
= 0;i
< count
;i
++)
385 device
->ChannelName
[i
] = VirtualChans
[i
].channel
;
386 SetChannelMap(device
, chanmap
, count
);
387 for(i
= 0;i
< count
;i
++)
389 device
->Hrtf
, VirtualChans
[i
].elevation
, VirtualChans
[i
].angle
, 1.0f
, 1.0f
,
390 device
->Hrtf_Params
[i
].Coeffs
, device
->Hrtf_Params
[i
].Delay
396 if(LoadChannelSetup(device
))
399 switch(device
->FmtChans
)
402 count
= COUNTOF(MonoCfg
);
407 count
= COUNTOF(StereoCfg
);
412 count
= COUNTOF(QuadCfg
);
417 count
= COUNTOF(X51SideCfg
);
418 chanmap
= X51SideCfg
;
422 count
= COUNTOF(X51RearCfg
);
423 chanmap
= X51RearCfg
;
427 count
= COUNTOF(X61Cfg
);
432 count
= COUNTOF(X71Cfg
);
436 case DevFmtBFormat3D
:
437 count
= COUNTOF(BFormat3D
);
442 SetChannelMap(device
, chanmap
, count
);