[1166] | 1 | /*
|
---|
| 2 | * Copyright (c) 2015 Mark Harmstone
|
---|
| 3 | *
|
---|
| 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.
|
---|
| 8 | *
|
---|
| 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.
|
---|
| 13 | *
|
---|
| 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
|
---|
| 17 | */
|
---|
| 18 |
|
---|
| 19 | import "unknwn.idl";
|
---|
| 20 | import "mmdeviceapi.idl";
|
---|
| 21 |
|
---|
| 22 | import "audiosessiontypes.h";
|
---|
| 23 |
|
---|
| 24 | cpp_quote("#include <pshpack1.h>")
|
---|
| 25 |
|
---|
| 26 | [
|
---|
| 27 | uuid(fac23f48-31f5-45a8-b49b-5225d61401aa)
|
---|
| 28 | ]
|
---|
| 29 | coclass XAudio20 {
|
---|
| 30 | interface IUnknown;
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | [
|
---|
| 34 | uuid(e21a7345-eb21-468e-be50-804db97cf708)
|
---|
| 35 | ]
|
---|
| 36 | coclass XAudio21 {
|
---|
| 37 | interface IUnknown;
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | [
|
---|
| 41 | uuid(b802058a-464a-42db-bc10-b650d6f2586a)
|
---|
| 42 | ]
|
---|
| 43 | coclass XAudio22 {
|
---|
| 44 | interface IUnknown;
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | [
|
---|
| 48 | uuid(4c5e637a-16c7-4de3-9c46-5ed22181962d)
|
---|
| 49 | ]
|
---|
| 50 | coclass XAudio23 {
|
---|
| 51 | interface IUnknown;
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 | [
|
---|
| 55 | uuid(03219e78-5bc3-44d1-b92e-f63d89cc6526)
|
---|
| 56 | ]
|
---|
| 57 | coclass XAudio24 {
|
---|
| 58 | interface IUnknown;
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | [
|
---|
| 62 | uuid(4c9b6dde-6809-46e6-a278-9b6a97588670)
|
---|
| 63 | ]
|
---|
| 64 | coclass XAudio25 {
|
---|
| 65 | interface IUnknown;
|
---|
| 66 | }
|
---|
| 67 |
|
---|
| 68 | [
|
---|
| 69 | uuid(3eda9b49-2085-498b-9bb2-39a6778493de)
|
---|
| 70 | ]
|
---|
| 71 | coclass XAudio26 {
|
---|
| 72 | interface IUnknown;
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | [
|
---|
| 76 | uuid(5a508685-a254-4fba-9b82-9a24b00306af)
|
---|
| 77 | ]
|
---|
| 78 | coclass XAudio27 {
|
---|
| 79 | interface IUnknown;
|
---|
| 80 | }
|
---|
| 81 |
|
---|
| 82 | [
|
---|
| 83 | uuid(db05ea35-0329-4d4b-a53a-6dead03d3852)
|
---|
| 84 | ]
|
---|
| 85 | coclass XAudio2Debug {
|
---|
| 86 | interface IUnknown;
|
---|
| 87 | }
|
---|
| 88 |
|
---|
| 89 | cpp_quote("#if 0")
|
---|
| 90 | typedef struct WAVEFORMATEX
|
---|
| 91 | {
|
---|
| 92 | WORD wFormatTag;
|
---|
| 93 | WORD nChannels;
|
---|
| 94 | DWORD nSamplesPerSec;
|
---|
| 95 | DWORD nAvgBytesPerSec;
|
---|
| 96 | WORD nBlockAlign;
|
---|
| 97 | WORD wBitsPerSample;
|
---|
| 98 | WORD cbSize;
|
---|
| 99 | } WAVEFORMATEX;
|
---|
| 100 |
|
---|
| 101 | typedef struct {
|
---|
| 102 | WAVEFORMATEX Format;
|
---|
| 103 | union {
|
---|
| 104 | WORD wValidBitsPerSample;
|
---|
| 105 | WORD wSamplesPerBlock;
|
---|
| 106 | WORD wReserved;
|
---|
| 107 | } Samples;
|
---|
| 108 | DWORD dwChannelMask;
|
---|
| 109 | GUID SubFormat;
|
---|
| 110 | } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
|
---|
| 111 | cpp_quote("#else")
|
---|
| 112 | cpp_quote("#include <mmreg.h>")
|
---|
| 113 | cpp_quote("#endif")
|
---|
| 114 |
|
---|
| 115 | interface IXAudio2Voice;
|
---|
| 116 |
|
---|
| 117 | typedef enum XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER
|
---|
| 118 | {
|
---|
| 119 | Processor1 = 0x00000001,
|
---|
| 120 | Processor2 = 0x00000002,
|
---|
| 121 | Processor3 = 0x00000004,
|
---|
| 122 | Processor4 = 0x00000008,
|
---|
| 123 | Processor5 = 0x00000010,
|
---|
| 124 | Processor6 = 0x00000020,
|
---|
| 125 | Processor7 = 0x00000040,
|
---|
| 126 | Processor8 = 0x00000080,
|
---|
| 127 | Processor9 = 0x00000100,
|
---|
| 128 | Processor10 = 0x00000200,
|
---|
| 129 | Processor11 = 0x00000400,
|
---|
| 130 | Processor12 = 0x00000800,
|
---|
| 131 | Processor13 = 0x00001000,
|
---|
| 132 | Processor14 = 0x00002000,
|
---|
| 133 | Processor15 = 0x00004000,
|
---|
| 134 | Processor16 = 0x00008000,
|
---|
| 135 | Processor17 = 0x00010000,
|
---|
| 136 | Processor18 = 0x00020000,
|
---|
| 137 | Processor19 = 0x00040000,
|
---|
| 138 | Processor20 = 0x00080000,
|
---|
| 139 | Processor21 = 0x00100000,
|
---|
| 140 | Processor22 = 0x00200000,
|
---|
| 141 | Processor23 = 0x00400000,
|
---|
| 142 | Processor24 = 0x00800000,
|
---|
| 143 | Processor25 = 0x01000000,
|
---|
| 144 | Processor26 = 0x02000000,
|
---|
| 145 | Processor27 = 0x04000000,
|
---|
| 146 | Processor28 = 0x08000000,
|
---|
| 147 | Processor29 = 0x10000000,
|
---|
| 148 | Processor30 = 0x20000000,
|
---|
| 149 | Processor31 = 0x40000000,
|
---|
| 150 | Processor32 = 0x80000000,
|
---|
| 151 | XAUDIO2_ANY_PROCESSOR = 0xffffffff,
|
---|
| 152 | XAUDIO2_DEFAULT_PROCESSOR = XAUDIO2_ANY_PROCESSOR
|
---|
| 153 | } XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER, XAUDIO2_PROCESSOR;
|
---|
| 154 |
|
---|
| 155 | typedef struct XAUDIO2_PERFORMANCE_DATA
|
---|
| 156 | {
|
---|
| 157 | UINT64 AudioCyclesSinceLastQuery;
|
---|
| 158 | UINT64 TotalCyclesSinceLastQuery;
|
---|
| 159 | UINT32 MinimumCyclesPerQuantum;
|
---|
| 160 | UINT32 MaximumCyclesPerQuantum;
|
---|
| 161 | UINT32 MemoryUsageInBytes;
|
---|
| 162 | UINT32 CurrentLatencyInSamples;
|
---|
| 163 | UINT32 GlitchesSinceEngineStarted;
|
---|
| 164 | UINT32 ActiveSourceVoiceCount;
|
---|
| 165 | UINT32 TotalSourceVoiceCount;
|
---|
| 166 | UINT32 ActiveSubmixVoiceCount;
|
---|
| 167 | UINT32 ActiveResamplerCount;
|
---|
| 168 | UINT32 ActiveMatrixMixCount;
|
---|
| 169 | UINT32 ActiveXmaSourceVoices;
|
---|
| 170 | UINT32 ActiveXmaStreams;
|
---|
| 171 | } XAUDIO2_PERFORMANCE_DATA;
|
---|
| 172 |
|
---|
| 173 | typedef struct XAUDIO22_PERFORMANCE_DATA
|
---|
| 174 | {
|
---|
| 175 | UINT64 AudioCyclesSinceLastQuery;
|
---|
| 176 | UINT64 TotalCyclesSinceLastQuery;
|
---|
| 177 | UINT32 MinimumCyclesPerQuantum;
|
---|
| 178 | UINT32 MaximumCyclesPerQuantum;
|
---|
| 179 | UINT32 MemoryUsageInBytes;
|
---|
| 180 | UINT32 CurrentLatencyInSamples;
|
---|
| 181 | UINT32 GlitchesSinceEngineStarted;
|
---|
| 182 | UINT32 ActiveSourceVoiceCount;
|
---|
| 183 | UINT32 TotalSourceVoiceCount;
|
---|
| 184 | UINT32 ActiveSubmixVoiceCount;
|
---|
| 185 | UINT32 TotalSubmixVoiceCount;
|
---|
| 186 | UINT32 ActiveXmaSourceVoices;
|
---|
| 187 | UINT32 ActiveXmaStreams;
|
---|
| 188 | } XAUDIO22_PERFORMANCE_DATA;
|
---|
| 189 |
|
---|
| 190 | typedef struct XAUDIO20_PERFORMANCE_DATA
|
---|
| 191 | {
|
---|
| 192 | UINT64 AudioCyclesSinceLastQuery;
|
---|
| 193 | UINT64 TotalCyclesSinceLastQuery;
|
---|
| 194 | UINT32 MinimumCyclesPerQuantum;
|
---|
| 195 | UINT32 MaximumCyclesPerQuantum;
|
---|
| 196 | UINT32 MemoryUsageInBytes;
|
---|
| 197 | UINT32 CurrentLatencyInSamples;
|
---|
| 198 | UINT32 GlitchesSinceLastQuery;
|
---|
| 199 | UINT32 ActiveSourceVoiceCount;
|
---|
| 200 | UINT32 TotalSourceVoiceCount;
|
---|
| 201 | UINT32 ActiveSubmixVoiceCount;
|
---|
| 202 | UINT32 TotalSubmixVoiceCount;
|
---|
| 203 | UINT32 ActiveXmaSourceVoices;
|
---|
| 204 | UINT32 ActiveXmaStreams;
|
---|
| 205 | } XAUDIO20_PERFORMANCE_DATA;
|
---|
| 206 |
|
---|
| 207 | typedef enum XAUDIO2_DEVICE_ROLE
|
---|
| 208 | {
|
---|
| 209 | NotDefaultDevice = 0x0,
|
---|
| 210 | DefaultConsoleDevice = 0x1,
|
---|
| 211 | DefaultMultimediaDevice = 0x2,
|
---|
| 212 | DefaultCommunicationsDevice = 0x4,
|
---|
| 213 | DefaultGameDevice = 0x8,
|
---|
| 214 | GlobalDefaultDevice = 0xf,
|
---|
| 215 | InvalidDeviceRole = ~GlobalDefaultDevice
|
---|
| 216 | } XAUDIO2_DEVICE_ROLE;
|
---|
| 217 |
|
---|
| 218 | typedef struct XAUDIO2_DEVICE_DETAILS
|
---|
| 219 | {
|
---|
| 220 | WCHAR DeviceID[256];
|
---|
| 221 | WCHAR DisplayName[256];
|
---|
| 222 | XAUDIO2_DEVICE_ROLE Role;
|
---|
| 223 | WAVEFORMATEXTENSIBLE OutputFormat;
|
---|
| 224 | } XAUDIO2_DEVICE_DETAILS;
|
---|
| 225 |
|
---|
| 226 | typedef struct XAUDIO27_VOICE_DETAILS
|
---|
| 227 | {
|
---|
| 228 | UINT32 CreationFlags;
|
---|
| 229 | UINT32 InputChannels;
|
---|
| 230 | UINT32 InputSampleRate;
|
---|
| 231 | } XAUDIO27_VOICE_DETAILS;
|
---|
| 232 |
|
---|
| 233 | typedef struct XAUDIO2_VOICE_DETAILS
|
---|
| 234 | {
|
---|
| 235 | UINT32 CreationFlags;
|
---|
| 236 | UINT32 ActiveFlags;
|
---|
| 237 | UINT32 InputChannels;
|
---|
| 238 | UINT32 InputSampleRate;
|
---|
| 239 | } XAUDIO2_VOICE_DETAILS;
|
---|
| 240 |
|
---|
| 241 | typedef struct XAUDIO2_SEND_DESCRIPTOR
|
---|
| 242 | {
|
---|
| 243 | UINT32 Flags;
|
---|
| 244 | IXAudio2Voice* pOutputVoice;
|
---|
| 245 | } XAUDIO2_SEND_DESCRIPTOR;
|
---|
| 246 |
|
---|
| 247 | /* XAudio2 2.3's XAUDIO2_VOICE_SENDS struct */
|
---|
| 248 | typedef struct XAUDIO23_VOICE_SENDS
|
---|
| 249 | {
|
---|
| 250 | UINT32 OutputCount;
|
---|
| 251 | IXAudio2Voice **pOutputVoices;
|
---|
| 252 | } XAUDIO23_VOICE_SENDS;
|
---|
| 253 |
|
---|
| 254 | typedef struct XAUDIO2_VOICE_SENDS
|
---|
| 255 | {
|
---|
| 256 | UINT32 SendCount;
|
---|
| 257 | XAUDIO2_SEND_DESCRIPTOR* pSends;
|
---|
| 258 | } XAUDIO2_VOICE_SENDS;
|
---|
| 259 |
|
---|
| 260 | typedef struct XAUDIO2_EFFECT_DESCRIPTOR
|
---|
| 261 | {
|
---|
| 262 | IUnknown* pEffect;
|
---|
| 263 | BOOL InitialState;
|
---|
| 264 | UINT32 OutputChannels;
|
---|
| 265 | } XAUDIO2_EFFECT_DESCRIPTOR;
|
---|
| 266 |
|
---|
| 267 | typedef struct XAUDIO2_EFFECT_CHAIN
|
---|
| 268 | {
|
---|
| 269 | UINT32 EffectCount;
|
---|
| 270 | XAUDIO2_EFFECT_DESCRIPTOR* pEffectDescriptors;
|
---|
| 271 | } XAUDIO2_EFFECT_CHAIN;
|
---|
| 272 |
|
---|
| 273 | const UINT32 XAUDIO2_MAX_BUFFER_BYTES = 0x80000000;
|
---|
| 274 | const UINT32 XAUDIO2_MAX_QUEUED_BUFFERS = 64;
|
---|
| 275 | const UINT32 XAUDIO2_MAX_BUFFERS_SYSTEM = 2;
|
---|
| 276 | const UINT32 XAUDIO2_MAX_AUDIO_CHANNELS = 64;
|
---|
| 277 | const UINT32 XAUDIO2_MIN_SAMPLE_RATE = 1000;
|
---|
| 278 | const UINT32 XAUDIO2_MAX_SAMPLE_RATE = 200000;
|
---|
| 279 | const float XAUDIO2_MAX_VOLUME_LEVEL = 16777216.0;
|
---|
| 280 | const float XAUDIO2_MIN_FREQ_RATIO = (1/1024.0);
|
---|
| 281 | const float XAUDIO2_MAX_FREQ_RATIO = 1024.0;
|
---|
| 282 | const float XAUDIO2_DEFAULT_FREQ_RATIO = 2.0;
|
---|
| 283 | const float XAUDIO2_MAX_FILTER_ONEOVERQ = 1.5;
|
---|
| 284 | const float XAUDIO2_MAX_FILTER_FREQUENCY = 1.0;
|
---|
| 285 | const UINT32 XAUDIO2_MAX_LOOP_COUNT = 254;
|
---|
| 286 | const UINT32 XAUDIO20_MAX_LOOP_COUNT = 0x100000; /* xaudio 2.0 */
|
---|
| 287 |
|
---|
| 288 | const UINT32 XAUDIO2_COMMIT_NOW = 0;
|
---|
| 289 | const UINT32 XAUDIO2_COMMIT_ALL = 0;
|
---|
| 290 | const UINT32 XAUDIO2_INVALID_OPSET = 0xffffffff;
|
---|
| 291 | const UINT32 XAUDIO2_NO_LOOP_REGION = 0;
|
---|
| 292 | const UINT32 XAUDIO2_LOOP_INFINITE = 255;
|
---|
| 293 | const UINT32 XAUDIO20_LOOP_INFINITE = ((UINT)-1); /* xaudio 2.0 */
|
---|
| 294 | const UINT32 XAUDIO2_DEFAULT_CHANNELS = 0;
|
---|
| 295 | const UINT32 XAUDIO2_DEFAULT_SAMPLERATE = 0;
|
---|
| 296 |
|
---|
| 297 | [
|
---|
| 298 | object,
|
---|
| 299 | local
|
---|
| 300 | ]
|
---|
| 301 | interface IXAudio2EngineCallback
|
---|
| 302 | {
|
---|
| 303 | void OnProcessingPassStart();
|
---|
| 304 |
|
---|
| 305 | void OnProcessingPassEnd();
|
---|
| 306 |
|
---|
| 307 | void OnCriticalError([in] HRESULT Error);
|
---|
| 308 | }
|
---|
| 309 |
|
---|
| 310 | typedef enum XAUDIO2_FILTER_TYPE
|
---|
| 311 | {
|
---|
| 312 | LowPassFilter,
|
---|
| 313 | BandPassFilter,
|
---|
| 314 | HighPassFilter,
|
---|
| 315 | NotchFilter
|
---|
| 316 | } XAUDIO2_FILTER_TYPE;
|
---|
| 317 |
|
---|
| 318 | typedef struct XAUDIO2_FILTER_PARAMETERS
|
---|
| 319 | {
|
---|
| 320 | XAUDIO2_FILTER_TYPE Type;
|
---|
| 321 | float Frequency;
|
---|
| 322 | float OneOverQ;
|
---|
| 323 | } XAUDIO2_FILTER_PARAMETERS;
|
---|
| 324 |
|
---|
| 325 | /* XAudio 2.0's IXAudio2Voice */
|
---|
| 326 | /* XAudio2 2.0's IXAudio2Voice interface. Actually called
|
---|
| 327 | * IXAudio2Voice in the Mar 2008 DX SDK */
|
---|
| 328 | [
|
---|
| 329 | object,
|
---|
| 330 | local
|
---|
| 331 | ]
|
---|
| 332 | interface IXAudio20Voice
|
---|
| 333 | {
|
---|
| 334 | void GetVoiceDetails([out] XAUDIO27_VOICE_DETAILS* pVoiceDetails);
|
---|
| 335 |
|
---|
| 336 | HRESULT SetOutputVoices([in] const XAUDIO23_VOICE_SENDS* pSendList);
|
---|
| 337 |
|
---|
| 338 | HRESULT SetEffectChain([in] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 339 |
|
---|
| 340 | HRESULT EnableEffect(
|
---|
| 341 | [in] UINT32 EffectIndex,
|
---|
| 342 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 343 |
|
---|
| 344 | HRESULT DisableEffect(
|
---|
| 345 | [in] UINT32 EffectIndex,
|
---|
| 346 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 347 |
|
---|
| 348 | void GetEffectState(
|
---|
| 349 | [in] UINT32 EffectIndex,
|
---|
| 350 | [out] BOOL* pEnabled);
|
---|
| 351 |
|
---|
| 352 | HRESULT SetEffectParameters(
|
---|
| 353 | [in] UINT32 EffectIndex,
|
---|
| 354 | [in] const void* pParameters,
|
---|
| 355 | [in] UINT32 ParametersByteSize,
|
---|
| 356 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 357 |
|
---|
| 358 | HRESULT GetEffectParameters(
|
---|
| 359 | [in] UINT32 EffectIndex,
|
---|
| 360 | [out] void* pParameters,
|
---|
| 361 | [in] UINT32 ParametersByteSize);
|
---|
| 362 |
|
---|
| 363 | HRESULT SetFilterParameters(
|
---|
| 364 | [in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
|
---|
| 365 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 366 |
|
---|
| 367 | void GetFilterParameters([out] XAUDIO2_FILTER_PARAMETERS* pParameters);
|
---|
| 368 |
|
---|
| 369 | HRESULT SetVolume(
|
---|
| 370 | [in] float Volume,
|
---|
| 371 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 372 |
|
---|
| 373 | void GetVolume([out] float* pVolume);
|
---|
| 374 |
|
---|
| 375 | HRESULT SetChannelVolumes(
|
---|
| 376 | [in] UINT32 Channels,
|
---|
| 377 | [in, size_is(Channels)] const float* pVolumes,
|
---|
| 378 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 379 |
|
---|
| 380 | void GetChannelVolumes(
|
---|
| 381 | [in] UINT32 Channels,
|
---|
| 382 | [out, size_is(Channels)] float* pVolumes);
|
---|
| 383 |
|
---|
| 384 | HRESULT SetOutputMatrix(
|
---|
| 385 | [in] IXAudio2Voice* pDestinationVoice,
|
---|
| 386 | [in] UINT32 SourceChannels,
|
---|
| 387 | [in] UINT32 DestinationChannels,
|
---|
| 388 | [in, size_is(SourceChannels * DestinationChannels)] const float* pLevelMatrix,
|
---|
| 389 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 390 |
|
---|
| 391 | HRESULT GetOutputMatrix(
|
---|
| 392 | [in] IXAudio2Voice* pDestinationVoice,
|
---|
| 393 | [in] UINT32 SourceChannels,
|
---|
| 394 | [in] UINT32 DestinationChannels,
|
---|
| 395 | [out, size_is(SourceChannels * DestinationChannels)] float* pLevelMatrix);
|
---|
| 396 |
|
---|
| 397 | void DestroyVoice();
|
---|
| 398 | }
|
---|
| 399 |
|
---|
| 400 | /* XAudio 2.3's IXAudio2Voice */
|
---|
| 401 | /* XAudio2 2.3's IXAudio2Voice interface. Actually called
|
---|
| 402 | * IXAudio2Voice in the Nov 2008 DX SDK */
|
---|
| 403 | [
|
---|
| 404 | object,
|
---|
| 405 | local
|
---|
| 406 | ]
|
---|
| 407 | interface IXAudio23Voice
|
---|
| 408 | {
|
---|
| 409 | void GetVoiceDetails([out] XAUDIO27_VOICE_DETAILS* pVoiceDetails);
|
---|
| 410 |
|
---|
| 411 | HRESULT SetOutputVoices([in] const XAUDIO23_VOICE_SENDS* pSendList);
|
---|
| 412 |
|
---|
| 413 | HRESULT SetEffectChain([in] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 414 |
|
---|
| 415 | HRESULT EnableEffect(
|
---|
| 416 | [in] UINT32 EffectIndex,
|
---|
| 417 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 418 |
|
---|
| 419 | HRESULT DisableEffect(
|
---|
| 420 | [in] UINT32 EffectIndex,
|
---|
| 421 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 422 |
|
---|
| 423 | void GetEffectState(
|
---|
| 424 | [in] UINT32 EffectIndex,
|
---|
| 425 | [out] BOOL* pEnabled);
|
---|
| 426 |
|
---|
| 427 | HRESULT SetEffectParameters(
|
---|
| 428 | [in] UINT32 EffectIndex,
|
---|
| 429 | [in] const void* pParameters,
|
---|
| 430 | [in] UINT32 ParametersByteSize,
|
---|
| 431 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 432 |
|
---|
| 433 | HRESULT GetEffectParameters(
|
---|
| 434 | [in] UINT32 EffectIndex,
|
---|
| 435 | [out] void* pParameters,
|
---|
| 436 | [in] UINT32 ParametersByteSize);
|
---|
| 437 |
|
---|
| 438 | HRESULT SetFilterParameters(
|
---|
| 439 | [in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
|
---|
| 440 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 441 |
|
---|
| 442 | void GetFilterParameters([out] XAUDIO2_FILTER_PARAMETERS* pParameters);
|
---|
| 443 |
|
---|
| 444 | HRESULT SetVolume(
|
---|
| 445 | [in] float Volume,
|
---|
| 446 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 447 |
|
---|
| 448 | void GetVolume([out] float* pVolume);
|
---|
| 449 |
|
---|
| 450 | HRESULT SetChannelVolumes(
|
---|
| 451 | [in] UINT32 Channels,
|
---|
| 452 | [in, size_is(Channels)] const float* pVolumes,
|
---|
| 453 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 454 |
|
---|
| 455 | void GetChannelVolumes(
|
---|
| 456 | [in] UINT32 Channels,
|
---|
| 457 | [out, size_is(Channels)] float* pVolumes);
|
---|
| 458 |
|
---|
| 459 | HRESULT SetOutputMatrix(
|
---|
| 460 | [in] IXAudio2Voice* pDestinationVoice,
|
---|
| 461 | [in] UINT32 SourceChannels,
|
---|
| 462 | [in] UINT32 DestinationChannels,
|
---|
| 463 | [in, size_is(SourceChannels * DestinationChannels)] const float* pLevelMatrix,
|
---|
| 464 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 465 |
|
---|
| 466 | void GetOutputMatrix(
|
---|
| 467 | [in] IXAudio2Voice* pDestinationVoice,
|
---|
| 468 | [in] UINT32 SourceChannels,
|
---|
| 469 | [in] UINT32 DestinationChannels,
|
---|
| 470 | [out, size_is(SourceChannels * DestinationChannels)] float* pLevelMatrix);
|
---|
| 471 |
|
---|
| 472 | void DestroyVoice();
|
---|
| 473 | }
|
---|
| 474 |
|
---|
| 475 | /* XAudio 2.7's IXAudio2Voice */
|
---|
| 476 | /* XAudio2 2.7's IXAudio2Voice interface. Actually called
|
---|
| 477 | * IXAudio2Voice in the Jun 2010 DX SDK */
|
---|
| 478 | [
|
---|
| 479 | object,
|
---|
| 480 | local
|
---|
| 481 | ]
|
---|
| 482 | interface IXAudio27Voice
|
---|
| 483 | {
|
---|
| 484 | void GetVoiceDetails([out] XAUDIO27_VOICE_DETAILS* pVoiceDetails);
|
---|
| 485 |
|
---|
| 486 | HRESULT SetOutputVoices([in] const XAUDIO2_VOICE_SENDS* pSendList);
|
---|
| 487 |
|
---|
| 488 | HRESULT SetEffectChain([in] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 489 |
|
---|
| 490 | HRESULT EnableEffect(
|
---|
| 491 | [in] UINT32 EffectIndex,
|
---|
| 492 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 493 |
|
---|
| 494 | HRESULT DisableEffect(
|
---|
| 495 | [in] UINT32 EffectIndex,
|
---|
| 496 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 497 |
|
---|
| 498 | void GetEffectState(
|
---|
| 499 | [in] UINT32 EffectIndex,
|
---|
| 500 | [out] BOOL* pEnabled);
|
---|
| 501 |
|
---|
| 502 | HRESULT SetEffectParameters(
|
---|
| 503 | [in] UINT32 EffectIndex,
|
---|
| 504 | [in] const void* pParameters,
|
---|
| 505 | [in] UINT32 ParametersByteSize,
|
---|
| 506 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 507 |
|
---|
| 508 | HRESULT GetEffectParameters(
|
---|
| 509 | [in] UINT32 EffectIndex,
|
---|
| 510 | [out] void* pParameters,
|
---|
| 511 | [in] UINT32 ParametersByteSize);
|
---|
| 512 |
|
---|
| 513 | HRESULT SetFilterParameters(
|
---|
| 514 | [in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
|
---|
| 515 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 516 |
|
---|
| 517 | void GetFilterParameters([out] XAUDIO2_FILTER_PARAMETERS* pParameters);
|
---|
| 518 |
|
---|
| 519 | HRESULT SetOutputFilterParameters(
|
---|
| 520 | [in] IXAudio2Voice* pDestinationVoice,
|
---|
| 521 | [in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
|
---|
| 522 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 523 |
|
---|
| 524 | void GetOutputFilterParameters(
|
---|
| 525 | [in] IXAudio2Voice* pDestinationVoice,
|
---|
| 526 | [out] XAUDIO2_FILTER_PARAMETERS* pParameters);
|
---|
| 527 |
|
---|
| 528 | HRESULT SetVolume(
|
---|
| 529 | [in] float Volume,
|
---|
| 530 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 531 |
|
---|
| 532 | void GetVolume([out] float* pVolume);
|
---|
| 533 |
|
---|
| 534 | HRESULT SetChannelVolumes(
|
---|
| 535 | [in] UINT32 Channels,
|
---|
| 536 | [in, size_is(Channels)] const float* pVolumes,
|
---|
| 537 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 538 |
|
---|
| 539 | void GetChannelVolumes(
|
---|
| 540 | [in] UINT32 Channels,
|
---|
| 541 | [out, size_is(Channels)] float* pVolumes);
|
---|
| 542 |
|
---|
| 543 | HRESULT SetOutputMatrix(
|
---|
| 544 | [in] IXAudio2Voice* pDestinationVoice,
|
---|
| 545 | [in] UINT32 SourceChannels,
|
---|
| 546 | [in] UINT32 DestinationChannels,
|
---|
| 547 | [in, size_is(SourceChannels * DestinationChannels)] const float* pLevelMatrix,
|
---|
| 548 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 549 |
|
---|
| 550 | void GetOutputMatrix(
|
---|
| 551 | [in] IXAudio2Voice* pDestinationVoice,
|
---|
| 552 | [in] UINT32 SourceChannels,
|
---|
| 553 | [in] UINT32 DestinationChannels,
|
---|
| 554 | [out, size_is(SourceChannels * DestinationChannels)] float* pLevelMatrix);
|
---|
| 555 |
|
---|
| 556 | void DestroyVoice();
|
---|
| 557 | }
|
---|
| 558 |
|
---|
| 559 | [
|
---|
| 560 | object,
|
---|
| 561 | local
|
---|
| 562 | ]
|
---|
| 563 | interface IXAudio2Voice
|
---|
| 564 | {
|
---|
| 565 | void GetVoiceDetails([out] XAUDIO2_VOICE_DETAILS* pVoiceDetails);
|
---|
| 566 |
|
---|
| 567 | HRESULT SetOutputVoices([in] const XAUDIO2_VOICE_SENDS* pSendList);
|
---|
| 568 |
|
---|
| 569 | HRESULT SetEffectChain([in] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 570 |
|
---|
| 571 | HRESULT EnableEffect(
|
---|
| 572 | [in] UINT32 EffectIndex,
|
---|
| 573 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 574 |
|
---|
| 575 | HRESULT DisableEffect(
|
---|
| 576 | [in] UINT32 EffectIndex,
|
---|
| 577 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 578 |
|
---|
| 579 | void GetEffectState(
|
---|
| 580 | [in] UINT32 EffectIndex,
|
---|
| 581 | [out] BOOL* pEnabled);
|
---|
| 582 |
|
---|
| 583 | HRESULT SetEffectParameters(
|
---|
| 584 | [in] UINT32 EffectIndex,
|
---|
| 585 | [in] const void* pParameters,
|
---|
| 586 | [in] UINT32 ParametersByteSize,
|
---|
| 587 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 588 |
|
---|
| 589 | HRESULT GetEffectParameters(
|
---|
| 590 | [in] UINT32 EffectIndex,
|
---|
| 591 | [out] void* pParameters,
|
---|
| 592 | [in] UINT32 ParametersByteSize);
|
---|
| 593 |
|
---|
| 594 | HRESULT SetFilterParameters(
|
---|
| 595 | [in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
|
---|
| 596 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 597 |
|
---|
| 598 | void GetFilterParameters([out] XAUDIO2_FILTER_PARAMETERS* pParameters);
|
---|
| 599 |
|
---|
| 600 | HRESULT SetOutputFilterParameters(
|
---|
| 601 | [in] IXAudio2Voice* pDestinationVoice,
|
---|
| 602 | [in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
|
---|
| 603 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 604 |
|
---|
| 605 | void GetOutputFilterParameters(
|
---|
| 606 | [in] IXAudio2Voice* pDestinationVoice,
|
---|
| 607 | [out] XAUDIO2_FILTER_PARAMETERS* pParameters);
|
---|
| 608 |
|
---|
| 609 | HRESULT SetVolume(
|
---|
| 610 | [in] float Volume,
|
---|
| 611 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 612 |
|
---|
| 613 | void GetVolume([out] float* pVolume);
|
---|
| 614 |
|
---|
| 615 | HRESULT SetChannelVolumes(
|
---|
| 616 | [in] UINT32 Channels,
|
---|
| 617 | [in, size_is(Channels)] const float* pVolumes,
|
---|
| 618 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 619 |
|
---|
| 620 | void GetChannelVolumes(
|
---|
| 621 | [in] UINT32 Channels,
|
---|
| 622 | [out, size_is(Channels)] float* pVolumes);
|
---|
| 623 |
|
---|
| 624 | HRESULT SetOutputMatrix(
|
---|
| 625 | [in] IXAudio2Voice* pDestinationVoice,
|
---|
| 626 | [in] UINT32 SourceChannels,
|
---|
| 627 | [in] UINT32 DestinationChannels,
|
---|
| 628 | [in, size_is(SourceChannels * DestinationChannels)] const float* pLevelMatrix,
|
---|
| 629 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 630 |
|
---|
| 631 | void GetOutputMatrix(
|
---|
| 632 | [in] IXAudio2Voice* pDestinationVoice,
|
---|
| 633 | [in] UINT32 SourceChannels,
|
---|
| 634 | [in] UINT32 DestinationChannels,
|
---|
| 635 | [out, size_is(SourceChannels * DestinationChannels)] float* pLevelMatrix);
|
---|
| 636 |
|
---|
| 637 | void DestroyVoice();
|
---|
| 638 | }
|
---|
| 639 |
|
---|
| 640 | typedef struct XAUDIO2_BUFFER
|
---|
| 641 | {
|
---|
| 642 | UINT32 Flags;
|
---|
| 643 | UINT32 AudioBytes;
|
---|
| 644 | const BYTE* pAudioData;
|
---|
| 645 | UINT32 PlayBegin;
|
---|
| 646 | UINT32 PlayLength;
|
---|
| 647 | UINT32 LoopBegin;
|
---|
| 648 | UINT32 LoopLength;
|
---|
| 649 | UINT32 LoopCount;
|
---|
| 650 | void* pContext;
|
---|
| 651 | } XAUDIO2_BUFFER;
|
---|
| 652 |
|
---|
| 653 | typedef struct XAUDIO2_BUFFER_WMA
|
---|
| 654 | {
|
---|
| 655 | const UINT32* pDecodedPacketCumulativeBytes;
|
---|
| 656 | UINT32 PacketCount;
|
---|
| 657 | } XAUDIO2_BUFFER_WMA;
|
---|
| 658 |
|
---|
| 659 | typedef struct XAUDIO2_VOICE_STATE
|
---|
| 660 | {
|
---|
| 661 | void* pCurrentBufferContext;
|
---|
| 662 | UINT32 BuffersQueued;
|
---|
| 663 | UINT64 SamplesPlayed;
|
---|
| 664 | } XAUDIO2_VOICE_STATE;
|
---|
| 665 |
|
---|
| 666 | [
|
---|
| 667 | local
|
---|
| 668 | ]
|
---|
| 669 | /* XAudio2 2.0's IXAudio2SourceVoice interface. Actually called
|
---|
| 670 | * IXAudio2SourceVoice in the Mar 2008 DX SDK */
|
---|
| 671 | interface IXAudio20SourceVoice : IXAudio20Voice
|
---|
| 672 | {
|
---|
| 673 | HRESULT Start(
|
---|
| 674 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 675 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 676 |
|
---|
| 677 | HRESULT Stop(
|
---|
| 678 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 679 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 680 |
|
---|
| 681 | HRESULT SubmitSourceBuffer(
|
---|
| 682 | [in] const XAUDIO2_BUFFER* pBuffer,
|
---|
| 683 | [in, defaultvalue(NULL)] const XAUDIO2_BUFFER_WMA* pBufferWMA);
|
---|
| 684 |
|
---|
| 685 | HRESULT FlushSourceBuffers();
|
---|
| 686 |
|
---|
| 687 | HRESULT Discontinuity();
|
---|
| 688 |
|
---|
| 689 | HRESULT ExitLoop([in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 690 |
|
---|
| 691 | void GetState([out] XAUDIO2_VOICE_STATE* pVoiceState);
|
---|
| 692 |
|
---|
| 693 | HRESULT SetFrequencyRatio(
|
---|
| 694 | [in] float Ratio,
|
---|
| 695 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 696 |
|
---|
| 697 | void GetFrequencyRatio([out] float* pRatio);
|
---|
| 698 | }
|
---|
| 699 |
|
---|
| 700 | [
|
---|
| 701 | local
|
---|
| 702 | ]
|
---|
| 703 | /* XAudio2 2.3's IXAudio2SourceVoice interface. Actually called
|
---|
| 704 | * IXAudio2SourceVoice in the Nov 2008 DX SDK */
|
---|
| 705 | interface IXAudio23SourceVoice : IXAudio23Voice
|
---|
| 706 | {
|
---|
| 707 | HRESULT Start(
|
---|
| 708 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 709 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 710 |
|
---|
| 711 | HRESULT Stop(
|
---|
| 712 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 713 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 714 |
|
---|
| 715 | HRESULT SubmitSourceBuffer(
|
---|
| 716 | [in] const XAUDIO2_BUFFER* pBuffer,
|
---|
| 717 | [in, defaultvalue(NULL)] const XAUDIO2_BUFFER_WMA* pBufferWMA);
|
---|
| 718 |
|
---|
| 719 | HRESULT FlushSourceBuffers();
|
---|
| 720 |
|
---|
| 721 | HRESULT Discontinuity();
|
---|
| 722 |
|
---|
| 723 | HRESULT ExitLoop([in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 724 |
|
---|
| 725 | void GetState([out] XAUDIO2_VOICE_STATE* pVoiceState);
|
---|
| 726 |
|
---|
| 727 | HRESULT SetFrequencyRatio(
|
---|
| 728 | [in] float Ratio,
|
---|
| 729 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 730 |
|
---|
| 731 | void GetFrequencyRatio([out] float* pRatio);
|
---|
| 732 | }
|
---|
| 733 |
|
---|
| 734 | [
|
---|
| 735 | local
|
---|
| 736 | ]
|
---|
| 737 | /* XAudio2 2.7's IXAudio2SourceVoice interface. Actually called
|
---|
| 738 | * IXAudio2SourceVoice in the Jun 2010 DX SDK */
|
---|
| 739 | interface IXAudio27SourceVoice : IXAudio27Voice
|
---|
| 740 | {
|
---|
| 741 | HRESULT Start(
|
---|
| 742 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 743 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 744 |
|
---|
| 745 | HRESULT Stop(
|
---|
| 746 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 747 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 748 |
|
---|
| 749 | HRESULT SubmitSourceBuffer(
|
---|
| 750 | [in] const XAUDIO2_BUFFER* pBuffer,
|
---|
| 751 | [in, defaultvalue(NULL)] const XAUDIO2_BUFFER_WMA* pBufferWMA);
|
---|
| 752 |
|
---|
| 753 | HRESULT FlushSourceBuffers();
|
---|
| 754 |
|
---|
| 755 | HRESULT Discontinuity();
|
---|
| 756 |
|
---|
| 757 | HRESULT ExitLoop([in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 758 |
|
---|
| 759 | void GetState([out] XAUDIO2_VOICE_STATE* pVoiceState);
|
---|
| 760 |
|
---|
| 761 | HRESULT SetFrequencyRatio(
|
---|
| 762 | [in] float Ratio,
|
---|
| 763 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 764 |
|
---|
| 765 | void GetFrequencyRatio([out] float* pRatio);
|
---|
| 766 |
|
---|
| 767 | HRESULT SetSourceSampleRate([in] UINT32 NewSourceSampleRate);
|
---|
| 768 | }
|
---|
| 769 |
|
---|
| 770 | [
|
---|
| 771 | local
|
---|
| 772 | ]
|
---|
| 773 | /* XAudio2 2.8's IXAudio2SourceVoice interface. */
|
---|
| 774 | interface IXAudio2SourceVoice : IXAudio2Voice
|
---|
| 775 | {
|
---|
| 776 | HRESULT Start(
|
---|
| 777 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 778 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 779 |
|
---|
| 780 | HRESULT Stop(
|
---|
| 781 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 782 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 783 |
|
---|
| 784 | HRESULT SubmitSourceBuffer(
|
---|
| 785 | [in] const XAUDIO2_BUFFER* pBuffer,
|
---|
| 786 | [in, defaultvalue(NULL)] const XAUDIO2_BUFFER_WMA* pBufferWMA);
|
---|
| 787 |
|
---|
| 788 | HRESULT FlushSourceBuffers();
|
---|
| 789 |
|
---|
| 790 | HRESULT Discontinuity();
|
---|
| 791 |
|
---|
| 792 | HRESULT ExitLoop([in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 793 |
|
---|
| 794 | void GetState([out] XAUDIO2_VOICE_STATE* pVoiceState, [in, defaultvalue(0)] UINT32 Flags);
|
---|
| 795 |
|
---|
| 796 | HRESULT SetFrequencyRatio(
|
---|
| 797 | [in] float Ratio,
|
---|
| 798 | [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
|
---|
| 799 |
|
---|
| 800 | void GetFrequencyRatio([out] float* pRatio);
|
---|
| 801 |
|
---|
| 802 | HRESULT SetSourceSampleRate([in] UINT32 NewSourceSampleRate);
|
---|
| 803 | }
|
---|
| 804 |
|
---|
| 805 | [
|
---|
| 806 | local
|
---|
| 807 | ]
|
---|
| 808 | /* XAudio2 2.0's IXAudio2SubmixVoice interface. Actually called
|
---|
| 809 | * IXAudio2SubmixVoice in the Mar 2008 DX SDK */
|
---|
| 810 | interface IXAudio20SubmixVoice : IXAudio20Voice
|
---|
| 811 | {
|
---|
| 812 | }
|
---|
| 813 |
|
---|
| 814 | [
|
---|
| 815 | local
|
---|
| 816 | ]
|
---|
| 817 | /* XAudio2 2.3's IXAudio2SubmixVoice interface. Actually called
|
---|
| 818 | * IXAudio2SubmixVoice in the Nov 2008 DX SDK */
|
---|
| 819 | interface IXAudio23SubmixVoice : IXAudio23Voice
|
---|
| 820 | {
|
---|
| 821 | }
|
---|
| 822 |
|
---|
| 823 | [
|
---|
| 824 | local
|
---|
| 825 | ]
|
---|
| 826 | /* XAudio2 2.7's IXAudio2SubmixVoice interface. Actually called
|
---|
| 827 | * IXAudio2SubmixVoice in the Jun 2010 DX SDK */
|
---|
| 828 | interface IXAudio27SubmixVoice : IXAudio27Voice
|
---|
| 829 | {
|
---|
| 830 | }
|
---|
| 831 |
|
---|
| 832 | [
|
---|
| 833 | local
|
---|
| 834 | ]
|
---|
| 835 | interface IXAudio2SubmixVoice : IXAudio2Voice
|
---|
| 836 | {
|
---|
| 837 | }
|
---|
| 838 |
|
---|
| 839 | [
|
---|
| 840 | local
|
---|
| 841 | ]
|
---|
| 842 | /* XAudio2 2.0's IXAudio2MasteringVoice interface. Actually called
|
---|
| 843 | * IXAudio2MasteringVoice in the Mar 2008 DX SDK */
|
---|
| 844 | interface IXAudio20MasteringVoice : IXAudio20Voice
|
---|
| 845 | {
|
---|
| 846 | }
|
---|
| 847 |
|
---|
| 848 | [
|
---|
| 849 | local
|
---|
| 850 | ]
|
---|
| 851 | /* XAudio2 2.3's IXAudio2MasteringVoice interface. Actually called
|
---|
| 852 | * IXAudio2MasteringVoice in the Nov 2008 DX SDK */
|
---|
| 853 | interface IXAudio23MasteringVoice : IXAudio23Voice
|
---|
| 854 | {
|
---|
| 855 | }
|
---|
| 856 |
|
---|
| 857 | [
|
---|
| 858 | local
|
---|
| 859 | ]
|
---|
| 860 | /* XAudio2 2.7's IXAudio2MasteringVoice interface. Actually called
|
---|
| 861 | * IXAudio2MasteringVoice in the Jun 2010 DX SDK */
|
---|
| 862 | interface IXAudio27MasteringVoice : IXAudio27Voice
|
---|
| 863 | {
|
---|
| 864 | }
|
---|
| 865 |
|
---|
| 866 | [
|
---|
| 867 | local
|
---|
| 868 | ]
|
---|
| 869 | interface IXAudio2MasteringVoice : IXAudio2Voice
|
---|
| 870 | {
|
---|
| 871 | /* not present in XAudio2 2.7 */
|
---|
| 872 | void GetChannelMask([out] DWORD *pChannelMask);
|
---|
| 873 | }
|
---|
| 874 |
|
---|
| 875 | [
|
---|
| 876 | object,
|
---|
| 877 | local
|
---|
| 878 | ]
|
---|
| 879 | interface IXAudio20VoiceCallback
|
---|
| 880 | {
|
---|
| 881 | void OnVoiceProcessingPassStart();
|
---|
| 882 |
|
---|
| 883 | void OnVoiceProcessingPassEnd();
|
---|
| 884 |
|
---|
| 885 | void OnStreamEnd();
|
---|
| 886 |
|
---|
| 887 | void OnBufferStart([in] void* pBufferContext);
|
---|
| 888 |
|
---|
| 889 | void OnBufferEnd([in] void* pBufferContext);
|
---|
| 890 |
|
---|
| 891 | void OnLoopEnd([in] void* pBufferContext);
|
---|
| 892 |
|
---|
| 893 | void OnVoiceError(
|
---|
| 894 | [in] void* pBuffercontext,
|
---|
| 895 | [in] HRESULT Error);
|
---|
| 896 | }
|
---|
| 897 |
|
---|
| 898 | [
|
---|
| 899 | object,
|
---|
| 900 | local
|
---|
| 901 | ]
|
---|
| 902 | interface IXAudio2VoiceCallback
|
---|
| 903 | {
|
---|
| 904 | void OnVoiceProcessingPassStart([in] UINT32 BytesRequired);
|
---|
| 905 |
|
---|
| 906 | void OnVoiceProcessingPassEnd();
|
---|
| 907 |
|
---|
| 908 | void OnStreamEnd();
|
---|
| 909 |
|
---|
| 910 | void OnBufferStart([in] void* pBufferContext);
|
---|
| 911 |
|
---|
| 912 | void OnBufferEnd([in] void* pBufferContext);
|
---|
| 913 |
|
---|
| 914 | void OnLoopEnd([in] void* pBufferContext);
|
---|
| 915 |
|
---|
| 916 | void OnVoiceError(
|
---|
| 917 | [in] void* pBuffercontext,
|
---|
| 918 | [in] HRESULT Error);
|
---|
| 919 | }
|
---|
| 920 |
|
---|
| 921 | typedef struct XAUDIO2_DEBUG_CONFIGURATION
|
---|
| 922 | {
|
---|
| 923 | UINT32 TraceMask;
|
---|
| 924 | UINT32 BreakMask;
|
---|
| 925 | BOOL LogThreadID;
|
---|
| 926 | BOOL LogFileline;
|
---|
| 927 | BOOL LogFunctionName;
|
---|
| 928 | BOOL LogTiming;
|
---|
| 929 | } XAUDIO2_DEBUG_CONFIGURATION;
|
---|
| 930 |
|
---|
| 931 | [
|
---|
| 932 | object,
|
---|
| 933 | uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb), /* all versions before 28 share IID_IXAudio */
|
---|
| 934 | ]
|
---|
| 935 | /* XAudio2 2.0's IXAudio2 interface. Actually called IXAudio2 in the Mar 2008
|
---|
| 936 | * DX SDK */
|
---|
| 937 | interface IXAudio20 : IUnknown
|
---|
| 938 | {
|
---|
| 939 | HRESULT GetDeviceCount([out] UINT32* pCount);
|
---|
| 940 |
|
---|
| 941 | HRESULT GetDeviceDetails(
|
---|
| 942 | [in] UINT32 Index,
|
---|
| 943 | [out] XAUDIO2_DEVICE_DETAILS* pDeviceDetails);
|
---|
| 944 |
|
---|
| 945 | HRESULT Initialize(
|
---|
| 946 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 947 | [in, defaultvalue(XAUDIO2_DEFAULT_PROCESSOR)] XAUDIO2_PROCESSOR XAudio2Processor);
|
---|
| 948 |
|
---|
| 949 | HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
|
---|
| 950 |
|
---|
| 951 | void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
|
---|
| 952 |
|
---|
| 953 | HRESULT CreateSourceVoice(
|
---|
| 954 | [out] IXAudio2SourceVoice** ppSourceVoice,
|
---|
| 955 | [in] const WAVEFORMATEX* pSourceFormat,
|
---|
| 956 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 957 | [in, defaultvalue(XAUDIO2_DEFAULT_FREQ_RATIO)] float MaxFrequencyRatio,
|
---|
| 958 | [in, defaultvalue(NULL)] IXAudio2VoiceCallback* pCallback,
|
---|
| 959 | [in, defaultvalue(NULL)] const XAUDIO23_VOICE_SENDS* pSendList,
|
---|
| 960 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 961 |
|
---|
| 962 | HRESULT CreateSubmixVoice(
|
---|
| 963 | [out] IXAudio2SubmixVoice** ppSubmixVoice,
|
---|
| 964 | [in] UINT32 InputChannels,
|
---|
| 965 | [in] UINT32 InputSampleRate,
|
---|
| 966 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 967 | [in, defaultvalue(0)] UINT32 ProcessingStage,
|
---|
| 968 | [in, defaultvalue(NULL)] const XAUDIO23_VOICE_SENDS* pSendList,
|
---|
| 969 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 970 |
|
---|
| 971 | HRESULT CreateMasteringVoice(
|
---|
| 972 | [out] IXAudio2MasteringVoice** ppMasteringVoice,
|
---|
| 973 | [in, defaultvalue(XAUDIO2_DEFAULT_CHANNELS)] UINT32 InputChannels,
|
---|
| 974 | [in, defaultvalue(XAUDIO2_DEFAULT_SAMPLERATE)] UINT32 InputSampleRate,
|
---|
| 975 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 976 | [in, defaultvalue(0)] UINT32 DeviceIndex,
|
---|
| 977 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 978 |
|
---|
| 979 | HRESULT StartEngine();
|
---|
| 980 |
|
---|
| 981 | void StopEngine();
|
---|
| 982 |
|
---|
| 983 | HRESULT CommitChanges([in] UINT32 OperationSet);
|
---|
| 984 |
|
---|
| 985 | void GetPerformanceData([out] XAUDIO20_PERFORMANCE_DATA* pPerfData);
|
---|
| 986 |
|
---|
| 987 | [local] void SetDebugConfiguration(
|
---|
| 988 | [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
|
---|
| 989 | [in, defaultvalue(NULL)] void* pReserved);
|
---|
| 990 | }
|
---|
| 991 |
|
---|
| 992 | [
|
---|
| 993 | object,
|
---|
| 994 | uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb), /* all versions before 28 share IID_IXAudio */
|
---|
| 995 | ]
|
---|
| 996 | /* XAudio2 2.2's IXAudio2 interface. Actually called IXAudio2 in the Jun 2010
|
---|
| 997 | * DX SDK */
|
---|
| 998 | interface IXAudio22 : IUnknown
|
---|
| 999 | {
|
---|
| 1000 | HRESULT GetDeviceCount([out] UINT32* pCount);
|
---|
| 1001 |
|
---|
| 1002 | HRESULT GetDeviceDetails(
|
---|
| 1003 | [in] UINT32 Index,
|
---|
| 1004 | [out] XAUDIO2_DEVICE_DETAILS* pDeviceDetails);
|
---|
| 1005 |
|
---|
| 1006 | HRESULT Initialize(
|
---|
| 1007 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1008 | [in, defaultvalue(XAUDIO2_DEFAULT_PROCESSOR)] XAUDIO2_PROCESSOR XAudio2Processor);
|
---|
| 1009 |
|
---|
| 1010 | HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
|
---|
| 1011 |
|
---|
| 1012 | void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
|
---|
| 1013 |
|
---|
| 1014 | HRESULT CreateSourceVoice(
|
---|
| 1015 | [out] IXAudio2SourceVoice** ppSourceVoice,
|
---|
| 1016 | [in] const WAVEFORMATEX* pSourceFormat,
|
---|
| 1017 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1018 | [in, defaultvalue(XAUDIO2_DEFAULT_FREQ_RATIO)] float MaxFrequencyRatio,
|
---|
| 1019 | [in, defaultvalue(NULL)] IXAudio2VoiceCallback* pCallback,
|
---|
| 1020 | [in, defaultvalue(NULL)] const XAUDIO23_VOICE_SENDS* pSendList,
|
---|
| 1021 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 1022 |
|
---|
| 1023 | HRESULT CreateSubmixVoice(
|
---|
| 1024 | [out] IXAudio2SubmixVoice** ppSubmixVoice,
|
---|
| 1025 | [in] UINT32 InputChannels,
|
---|
| 1026 | [in] UINT32 InputSampleRate,
|
---|
| 1027 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1028 | [in, defaultvalue(0)] UINT32 ProcessingStage,
|
---|
| 1029 | [in, defaultvalue(NULL)] const XAUDIO23_VOICE_SENDS* pSendList,
|
---|
| 1030 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 1031 |
|
---|
| 1032 | HRESULT CreateMasteringVoice(
|
---|
| 1033 | [out] IXAudio2MasteringVoice** ppMasteringVoice,
|
---|
| 1034 | [in, defaultvalue(XAUDIO2_DEFAULT_CHANNELS)] UINT32 InputChannels,
|
---|
| 1035 | [in, defaultvalue(XAUDIO2_DEFAULT_SAMPLERATE)] UINT32 InputSampleRate,
|
---|
| 1036 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1037 | [in, defaultvalue(0)] UINT32 DeviceIndex,
|
---|
| 1038 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 1039 |
|
---|
| 1040 | HRESULT StartEngine();
|
---|
| 1041 |
|
---|
| 1042 | void StopEngine();
|
---|
| 1043 |
|
---|
| 1044 | HRESULT CommitChanges([in] UINT32 OperationSet);
|
---|
| 1045 |
|
---|
| 1046 | void GetPerformanceData([out] XAUDIO22_PERFORMANCE_DATA* pPerfData);
|
---|
| 1047 |
|
---|
| 1048 | [local] void SetDebugConfiguration(
|
---|
| 1049 | [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
|
---|
| 1050 | [in, defaultvalue(NULL)] void* pReserved);
|
---|
| 1051 | }
|
---|
| 1052 |
|
---|
| 1053 | [
|
---|
| 1054 | object,
|
---|
| 1055 | uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb), /* all versions before 28 share IID_IXAudio */
|
---|
| 1056 | ]
|
---|
| 1057 | /* XAudio2 2.3's IXAudio2 interface. Actually called IXAudio2 in the Nov 2008
|
---|
| 1058 | * DX SDK */
|
---|
| 1059 | interface IXAudio23 : IUnknown
|
---|
| 1060 | {
|
---|
| 1061 | HRESULT GetDeviceCount([out] UINT32* pCount);
|
---|
| 1062 |
|
---|
| 1063 | HRESULT GetDeviceDetails(
|
---|
| 1064 | [in] UINT32 Index,
|
---|
| 1065 | [out] XAUDIO2_DEVICE_DETAILS* pDeviceDetails);
|
---|
| 1066 |
|
---|
| 1067 | HRESULT Initialize(
|
---|
| 1068 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1069 | [in, defaultvalue(XAUDIO2_DEFAULT_PROCESSOR)] XAUDIO2_PROCESSOR XAudio2Processor);
|
---|
| 1070 |
|
---|
| 1071 | HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
|
---|
| 1072 |
|
---|
| 1073 | void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
|
---|
| 1074 |
|
---|
| 1075 | HRESULT CreateSourceVoice(
|
---|
| 1076 | [out] IXAudio2SourceVoice** ppSourceVoice,
|
---|
| 1077 | [in] const WAVEFORMATEX* pSourceFormat,
|
---|
| 1078 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1079 | [in, defaultvalue(XAUDIO2_DEFAULT_FREQ_RATIO)] float MaxFrequencyRatio,
|
---|
| 1080 | [in, defaultvalue(NULL)] IXAudio2VoiceCallback* pCallback,
|
---|
| 1081 | [in, defaultvalue(NULL)] const XAUDIO23_VOICE_SENDS* pSendList,
|
---|
| 1082 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 1083 |
|
---|
| 1084 | HRESULT CreateSubmixVoice(
|
---|
| 1085 | [out] IXAudio2SubmixVoice** ppSubmixVoice,
|
---|
| 1086 | [in] UINT32 InputChannels,
|
---|
| 1087 | [in] UINT32 InputSampleRate,
|
---|
| 1088 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1089 | [in, defaultvalue(0)] UINT32 ProcessingStage,
|
---|
| 1090 | [in, defaultvalue(NULL)] const XAUDIO23_VOICE_SENDS* pSendList,
|
---|
| 1091 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 1092 |
|
---|
| 1093 | HRESULT CreateMasteringVoice(
|
---|
| 1094 | [out] IXAudio2MasteringVoice** ppMasteringVoice,
|
---|
| 1095 | [in, defaultvalue(XAUDIO2_DEFAULT_CHANNELS)] UINT32 InputChannels,
|
---|
| 1096 | [in, defaultvalue(XAUDIO2_DEFAULT_SAMPLERATE)] UINT32 InputSampleRate,
|
---|
| 1097 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1098 | [in, defaultvalue(0)] UINT32 DeviceIndex,
|
---|
| 1099 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 1100 |
|
---|
| 1101 | HRESULT StartEngine();
|
---|
| 1102 |
|
---|
| 1103 | void StopEngine();
|
---|
| 1104 |
|
---|
| 1105 | HRESULT CommitChanges([in] UINT32 OperationSet);
|
---|
| 1106 |
|
---|
| 1107 | void GetPerformanceData([out] XAUDIO2_PERFORMANCE_DATA* pPerfData);
|
---|
| 1108 |
|
---|
| 1109 | [local] void SetDebugConfiguration(
|
---|
| 1110 | [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
|
---|
| 1111 | [in, defaultvalue(NULL)] void* pReserved);
|
---|
| 1112 | }
|
---|
| 1113 |
|
---|
| 1114 | [
|
---|
| 1115 | object,
|
---|
| 1116 | uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb),
|
---|
| 1117 | ]
|
---|
| 1118 | /* XAudio2 2.7's IXAudio2 interface. Actually called IXAudio2 in the Jun 2010
|
---|
| 1119 | * DX SDK */
|
---|
| 1120 | interface IXAudio27 : IUnknown
|
---|
| 1121 | {
|
---|
| 1122 | HRESULT GetDeviceCount([out] UINT32* pCount);
|
---|
| 1123 |
|
---|
| 1124 | HRESULT GetDeviceDetails(
|
---|
| 1125 | [in] UINT32 Index,
|
---|
| 1126 | [out] XAUDIO2_DEVICE_DETAILS* pDeviceDetails);
|
---|
| 1127 |
|
---|
| 1128 | HRESULT Initialize(
|
---|
| 1129 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1130 | [in, defaultvalue(XAUDIO2_DEFAULT_PROCESSOR)] XAUDIO2_PROCESSOR XAudio2Processor);
|
---|
| 1131 |
|
---|
| 1132 | HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
|
---|
| 1133 |
|
---|
| 1134 | void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
|
---|
| 1135 |
|
---|
| 1136 | HRESULT CreateSourceVoice(
|
---|
| 1137 | [out] IXAudio2SourceVoice** ppSourceVoice,
|
---|
| 1138 | [in] const WAVEFORMATEX* pSourceFormat,
|
---|
| 1139 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1140 | [in, defaultvalue(XAUDIO2_DEFAULT_FREQ_RATIO)] float MaxFrequencyRatio,
|
---|
| 1141 | [in, defaultvalue(NULL)] IXAudio2VoiceCallback* pCallback,
|
---|
| 1142 | [in, defaultvalue(NULL)] const XAUDIO2_VOICE_SENDS* pSendList,
|
---|
| 1143 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 1144 |
|
---|
| 1145 | HRESULT CreateSubmixVoice(
|
---|
| 1146 | [out] IXAudio2SubmixVoice** ppSubmixVoice,
|
---|
| 1147 | [in] UINT32 InputChannels,
|
---|
| 1148 | [in] UINT32 InputSampleRate,
|
---|
| 1149 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1150 | [in, defaultvalue(0)] UINT32 ProcessingStage,
|
---|
| 1151 | [in, defaultvalue(NULL)] const XAUDIO2_VOICE_SENDS* pSendList,
|
---|
| 1152 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 1153 |
|
---|
| 1154 | HRESULT CreateMasteringVoice(
|
---|
| 1155 | [out] IXAudio2MasteringVoice** ppMasteringVoice,
|
---|
| 1156 | [in, defaultvalue(XAUDIO2_DEFAULT_CHANNELS)] UINT32 InputChannels,
|
---|
| 1157 | [in, defaultvalue(XAUDIO2_DEFAULT_SAMPLERATE)] UINT32 InputSampleRate,
|
---|
| 1158 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1159 | [in, defaultvalue(0)] UINT32 DeviceIndex,
|
---|
| 1160 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 1161 |
|
---|
| 1162 | HRESULT StartEngine();
|
---|
| 1163 |
|
---|
| 1164 | void StopEngine();
|
---|
| 1165 |
|
---|
| 1166 | HRESULT CommitChanges([in] UINT32 OperationSet);
|
---|
| 1167 |
|
---|
| 1168 | void GetPerformanceData([out] XAUDIO2_PERFORMANCE_DATA* pPerfData);
|
---|
| 1169 |
|
---|
| 1170 | [local] void SetDebugConfiguration(
|
---|
| 1171 | [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
|
---|
| 1172 | [in, defaultvalue(NULL)] void* pReserved);
|
---|
| 1173 | }
|
---|
| 1174 |
|
---|
| 1175 | /* XAudio2 2.8's IXAudio2 is identical to 2.9's */
|
---|
| 1176 | cpp_quote("DEFINE_GUID(IID_IXAudio28, 0x60d8dac8, 0x5aa1, 0x4e8e, 0xb5, 0x97, 0x2f, 0x5e, 0x28, 0x83, 0xd4, 0x84);")
|
---|
| 1177 |
|
---|
| 1178 | [
|
---|
| 1179 | object,
|
---|
| 1180 | uuid(2b02e3cf-2e0b-4ec3-be45-1b2a3fe7210d)
|
---|
| 1181 | ]
|
---|
| 1182 | /* XAudio2 2.9's IXAudio2 interface. */
|
---|
| 1183 | interface IXAudio2 : IUnknown
|
---|
| 1184 | {
|
---|
| 1185 | HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
|
---|
| 1186 |
|
---|
| 1187 | void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
|
---|
| 1188 |
|
---|
| 1189 | HRESULT CreateSourceVoice(
|
---|
| 1190 | [out] IXAudio2SourceVoice** ppSourceVoice,
|
---|
| 1191 | [in] const WAVEFORMATEX* pSourceFormat,
|
---|
| 1192 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1193 | [in, defaultvalue(XAUDIO2_DEFAULT_FREQ_RATIO)] float MaxFrequencyRatio,
|
---|
| 1194 | [in, defaultvalue(NULL)] IXAudio2VoiceCallback* pCallback,
|
---|
| 1195 | [in, defaultvalue(NULL)] const XAUDIO2_VOICE_SENDS* pSendList,
|
---|
| 1196 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 1197 |
|
---|
| 1198 | HRESULT CreateSubmixVoice(
|
---|
| 1199 | [out] IXAudio2SubmixVoice** ppSubmixVoice,
|
---|
| 1200 | [in] UINT32 InputChannels,
|
---|
| 1201 | [in] UINT32 InputSampleRate,
|
---|
| 1202 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1203 | [in, defaultvalue(0)] UINT32 ProcessingStage,
|
---|
| 1204 | [in, defaultvalue(NULL)] const XAUDIO2_VOICE_SENDS* pSendList,
|
---|
| 1205 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
|
---|
| 1206 |
|
---|
| 1207 | HRESULT CreateMasteringVoice(
|
---|
| 1208 | [out] IXAudio2MasteringVoice** ppMasteringVoice,
|
---|
| 1209 | [in, defaultvalue(XAUDIO2_DEFAULT_CHANNELS)] UINT32 InputChannels,
|
---|
| 1210 | [in, defaultvalue(XAUDIO2_DEFAULT_SAMPLERATE)] UINT32 InputSampleRate,
|
---|
| 1211 | [in, defaultvalue(0)] UINT32 Flags,
|
---|
| 1212 | [in, defaultvalue(NULL)] LPCWSTR DeviceId,
|
---|
| 1213 | [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain,
|
---|
| 1214 | [in, defaultvalue(AudioCategory_GameEffects)] AUDIO_STREAM_CATEGORY StreamCategory);
|
---|
| 1215 |
|
---|
| 1216 | HRESULT StartEngine();
|
---|
| 1217 |
|
---|
| 1218 | void StopEngine();
|
---|
| 1219 |
|
---|
| 1220 | HRESULT CommitChanges([in] UINT32 OperationSet);
|
---|
| 1221 |
|
---|
| 1222 | void GetPerformanceData([out] XAUDIO2_PERFORMANCE_DATA* pPerfData);
|
---|
| 1223 |
|
---|
| 1224 | [local] void SetDebugConfiguration(
|
---|
| 1225 | [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
|
---|
| 1226 | [in, defaultvalue(NULL)] void* pReserved);
|
---|
| 1227 | }
|
---|
| 1228 |
|
---|
| 1229 | const UINT32 XAUDIO2_DEBUG_ENGINE = 1;
|
---|
| 1230 | const UINT32 XAUDIO2_VOICE_NOPITCH = 2;
|
---|
| 1231 | const UINT32 XAUDIO2_VOICE_NOSRC = 4;
|
---|
| 1232 | const UINT32 XAUDIO2_VOICE_USEFILTER = 8;
|
---|
| 1233 | const UINT32 XAUDIO2_VOICE_MUSIC = 16;
|
---|
| 1234 | const UINT32 XAUDIO2_PLAY_TAILS = 32;
|
---|
| 1235 | const UINT32 XAUDIO2_END_OF_STREAM = 64;
|
---|
| 1236 | const UINT32 XAUDIO2_SEND_USEFILTER = 128;
|
---|
| 1237 | const UINT32 XAUDIO2_VOICE_NOSAMPLESPLAYED = 256;
|
---|
| 1238 |
|
---|
| 1239 | const XAUDIO2_FILTER_TYPE XAUDIO2_DEFAULT_FILTER_TYPE = LowPassFilter;
|
---|
| 1240 | const float XAUDIO2_DEFAULT_FILTER_FREQUENCY = XAUDIO2_MAX_FILTER_FREQUENCY;
|
---|
| 1241 | const float XAUDIO2_DEFAULT_FILTER_ONEOVERQ = 1.0;
|
---|
| 1242 | const UINT32 XAUDIO2_QUANTUM_NUMERATOR = 1;
|
---|
| 1243 | const UINT32 XAUDIO2_QUANTUM_DENOMINATOR = 100;
|
---|
| 1244 | const float XAUDIO2_QUANTUM_MS = (1000.0 * XAUDIO2_QUANTUM_NUMERATOR / XAUDIO2_QUANTUM_DENOMINATOR);
|
---|
| 1245 |
|
---|
| 1246 | /* use cpp_quote to retain the HRESULT type in header file */
|
---|
| 1247 | cpp_quote("#define XAUDIO2_E_INVALID_CALL ((HRESULT)0x88960001)")
|
---|
| 1248 | cpp_quote("#define XAUDIO2_E_XMA_DECODER_ERROR ((HRESULT)0x88960002)")
|
---|
| 1249 | cpp_quote("#define XAUDIO2_E_XAPO_CREATION_FAILED ((HRESULT)0x88960003)")
|
---|
| 1250 | cpp_quote("#define XAUDIO2_E_DEVICE_INVALIDATED ((HRESULT)0x88960004)")
|
---|
| 1251 |
|
---|
| 1252 | /* xaudio 2.0 error codes */
|
---|
| 1253 | cpp_quote("#define XAUDIO20_E_XMA_DECODER_ERROR ((HRESULT)0x88960001)")
|
---|
| 1254 | cpp_quote("#define XAUDIO20_E_XAPO_CREATION_FAILED ((HRESULT)0x88960002)")
|
---|
| 1255 | cpp_quote("#define XAUDIO20_E_DEVICE_INVALIDATED ((HRESULT)0x88960003)")
|
---|
| 1256 |
|
---|
| 1257 | cpp_quote("#ifdef XAUDIO2_HELPER_FUNCTIONS")
|
---|
| 1258 | cpp_quote("#define _USE_MATH_DEFINES")
|
---|
| 1259 | cpp_quote("#include <math.h>")
|
---|
| 1260 | cpp_quote("inline static float XAudio2DecibelsToAmplitudeRatio(float decibels) { return powf(10.0f, decibels/20.0f); }")
|
---|
| 1261 | cpp_quote("inline static float XAudio2AmplitudeRatioToDecibels(float volume) { if (volume == 0) { return -3.402823466e+38f; } return 20.0f * log10f(volume); }")
|
---|
| 1262 | cpp_quote("inline static float XAudio2SemitonesToFrequencyRatio(float semitones) { return powf(2.0f, semitones/12.0f); }")
|
---|
| 1263 | cpp_quote("inline static float XAudio2FrequencyRatioToSemitones(float freqratio) { return 39.86313713864835f * log10f(freqratio); }")
|
---|
| 1264 | cpp_quote("inline static float XAudio2CutoffFrequencyToRadians(float cutofffreq, UINT32 samplerate) { if ((UINT32)(cutofffreq * 6.0f) >= samplerate) { return XAUDIO2_MAX_FILTER_FREQUENCY; } return 2.0f * sinf((float)M_PI * cutofffreq / samplerate); }")
|
---|
| 1265 | cpp_quote("inline static float XAudio2RadiansToCutoffFrequency(float radians, float samplerate) { return samplerate * asinf(radians/2.0f) / (float)M_PI; }")
|
---|
| 1266 | cpp_quote("#endif")
|
---|
| 1267 |
|
---|
| 1268 | cpp_quote("HRESULT WINAPI XAudio2Create(IXAudio2** pxaudio2, UINT32 flags, XAUDIO2_PROCESSOR processor);")
|
---|
| 1269 |
|
---|
| 1270 | cpp_quote("#include <poppack.h>")
|
---|