2 * Copyright (c) 2015 Andrew Eikum for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 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 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 typedef struct X3DAUDIO_VECTOR
{
26 typedef struct X3DAUDIO_CONE
{
37 typedef struct X3DAUDIO_DISTANCE_CURVE_POINT
{
40 } X3DAUDIO_DISTANCE_CURVE_POINT
;
42 typedef struct X3DAUDIO_DISTANCE_CURVE
{
43 X3DAUDIO_DISTANCE_CURVE_POINT
*pPoints
;
45 } X3DAUDIO_DISTANCE_CURVE
;
47 typedef struct X3DAUDIO_LISTENER
{
48 X3DAUDIO_VECTOR OrientFront
;
49 X3DAUDIO_VECTOR OrientTop
;
50 X3DAUDIO_VECTOR Position
;
51 X3DAUDIO_VECTOR Velocity
;
55 typedef struct X3DAUDIO_EMITTER
{
57 X3DAUDIO_VECTOR OrientFront
;
58 X3DAUDIO_VECTOR OrientTop
;
59 X3DAUDIO_VECTOR Position
;
60 X3DAUDIO_VECTOR Velocity
;
62 float InnerRadiusAngle
;
65 float *pChannelAzimuths
;
66 X3DAUDIO_DISTANCE_CURVE
*pVolumeCurve
;
67 X3DAUDIO_DISTANCE_CURVE
*pLFECurve
;
68 X3DAUDIO_DISTANCE_CURVE
*pLPFDirectCurve
;
69 X3DAUDIO_DISTANCE_CURVE
*pLPFReverbCurve
;
70 X3DAUDIO_DISTANCE_CURVE
*pReverbCurve
;
71 float CurveDistanceScalar
;
75 typedef struct X3DAUDIO_DSP_SETTINGS
{
76 float *pMatrixCoefficients
;
78 UINT32 SrcChannelCount
;
79 UINT32 DstChannelCount
;
80 float LPFDirectCoefficient
;
81 float LPFReverbCoefficient
;
84 float EmitterToListenerAngle
;
85 float EmitterToListenerDistance
;
86 float EmitterVelocityComponent
;
87 float ListenerVelocityComponent
;
88 } X3DAUDIO_DSP_SETTINGS
;
90 #define X3DAUDIO_CALCULATE_MATRIX 0x00000001
91 #define X3DAUDIO_CALCULATE_DELAY 0x00000002
92 #define X3DAUDIO_CALCULATE_LPF_DIRECT 0x00000004
93 #define X3DAUDIO_CALCULATE_LPF_REVERB 0x00000008
94 #define X3DAUDIO_CALCULATE_REVERB 0x00000010
95 #define X3DAUDIO_CALCULATE_DOPPLER 0x00000020
96 #define X3DAUDIO_CALCULATE_EMITTER_ANGLE 0x00000040
97 #define X3DAUDIO_CALCULATE_ZEROCENTER 0x00010000
98 #define X3DAUDIO_CALCULATE_REDIRECT_TO_LFE 0x00020000
100 #define X3DAUDIO_HANDLE_BYTESIZE 20
101 typedef BYTE X3DAUDIO_HANDLE
[X3DAUDIO_HANDLE_BYTESIZE
];
103 HRESULT CDECL
X3DAudioInitialize(UINT32
, float, X3DAUDIO_HANDLE
);
104 void CDECL
X3DAudioCalculate(const X3DAUDIO_HANDLE
, const X3DAUDIO_LISTENER
*,
105 const X3DAUDIO_EMITTER
*, UINT32
, X3DAUDIO_DSP_SETTINGS
*);