mshtml: Implement performance.timing.msFirstPaint.
[wine.git] / include / xaudio2.idl
blob3201e86e31af05e2408f98bf8837c4067fa6b737
1 /*
2 * Copyright (c) 2015 Mark Harmstone
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
19 import "unknwn.idl";
20 import "mmdeviceapi.idl";
22 import "audiosessiontypes.h";
24 cpp_quote("#include <pshpack1.h>")
27 uuid(fac23f48-31f5-45a8-b49b-5225d61401aa)
29 coclass XAudio20 {
30 interface IUnknown;
34 uuid(e21a7345-eb21-468e-be50-804db97cf708)
36 coclass XAudio21 {
37 interface IUnknown;
41 uuid(b802058a-464a-42db-bc10-b650d6f2586a)
43 coclass XAudio22 {
44 interface IUnknown;
48 uuid(4c5e637a-16c7-4de3-9c46-5ed22181962d)
50 coclass XAudio23 {
51 interface IUnknown;
55 uuid(03219e78-5bc3-44d1-b92e-f63d89cc6526)
57 coclass XAudio24 {
58 interface IUnknown;
62 uuid(4c9b6dde-6809-46e6-a278-9b6a97588670)
64 coclass XAudio25 {
65 interface IUnknown;
69 uuid(3eda9b49-2085-498b-9bb2-39a6778493de)
71 coclass XAudio26 {
72 interface IUnknown;
76 uuid(5a508685-a254-4fba-9b82-9a24b00306af)
78 coclass XAudio27 {
79 interface IUnknown;
83 uuid(db05ea35-0329-4d4b-a53a-6dead03d3852)
85 coclass XAudio2Debug {
86 interface IUnknown;
89 cpp_quote("#if 0")
90 typedef struct WAVEFORMATEX
92 WORD wFormatTag;
93 WORD nChannels;
94 DWORD nSamplesPerSec;
95 DWORD nAvgBytesPerSec;
96 WORD nBlockAlign;
97 WORD wBitsPerSample;
98 WORD cbSize;
99 } WAVEFORMATEX;
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")
115 interface IXAudio2Voice;
117 typedef enum XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER
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;
155 typedef struct XAUDIO2_PERFORMANCE_DATA
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;
173 typedef struct XAUDIO22_PERFORMANCE_DATA
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;
190 typedef struct XAUDIO20_PERFORMANCE_DATA
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;
207 typedef enum XAUDIO2_DEVICE_ROLE
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;
218 typedef struct XAUDIO2_DEVICE_DETAILS
220 WCHAR DeviceID[256];
221 WCHAR DisplayName[256];
222 XAUDIO2_DEVICE_ROLE Role;
223 WAVEFORMATEXTENSIBLE OutputFormat;
224 } XAUDIO2_DEVICE_DETAILS;
226 typedef struct XAUDIO27_VOICE_DETAILS
228 UINT32 CreationFlags;
229 UINT32 InputChannels;
230 UINT32 InputSampleRate;
231 } XAUDIO27_VOICE_DETAILS;
233 typedef struct XAUDIO2_VOICE_DETAILS
235 UINT32 CreationFlags;
236 UINT32 ActiveFlags;
237 UINT32 InputChannels;
238 UINT32 InputSampleRate;
239 } XAUDIO2_VOICE_DETAILS;
241 typedef struct XAUDIO2_SEND_DESCRIPTOR
243 UINT32 Flags;
244 IXAudio2Voice* pOutputVoice;
245 } XAUDIO2_SEND_DESCRIPTOR;
247 /* XAudio2 2.3's XAUDIO2_VOICE_SENDS struct */
248 typedef struct XAUDIO23_VOICE_SENDS
250 UINT32 OutputCount;
251 IXAudio2Voice **pOutputVoices;
252 } XAUDIO23_VOICE_SENDS;
254 typedef struct XAUDIO2_VOICE_SENDS
256 UINT32 SendCount;
257 XAUDIO2_SEND_DESCRIPTOR* pSends;
258 } XAUDIO2_VOICE_SENDS;
260 typedef struct XAUDIO2_EFFECT_DESCRIPTOR
262 IUnknown* pEffect;
263 BOOL InitialState;
264 UINT32 OutputChannels;
265 } XAUDIO2_EFFECT_DESCRIPTOR;
267 typedef struct XAUDIO2_EFFECT_CHAIN
269 UINT32 EffectCount;
270 XAUDIO2_EFFECT_DESCRIPTOR* pEffectDescriptors;
271 } XAUDIO2_EFFECT_CHAIN;
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 */
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;
298 object,
299 local
301 interface IXAudio2EngineCallback
303 void OnProcessingPassStart();
305 void OnProcessingPassEnd();
307 void OnCriticalError([in] HRESULT Error);
310 typedef enum XAUDIO2_FILTER_TYPE
312 LowPassFilter,
313 BandPassFilter,
314 HighPassFilter,
315 NotchFilter
316 } XAUDIO2_FILTER_TYPE;
318 typedef struct XAUDIO2_FILTER_PARAMETERS
320 XAUDIO2_FILTER_TYPE Type;
321 float Frequency;
322 float OneOverQ;
323 } XAUDIO2_FILTER_PARAMETERS;
325 /* XAudio 2.0's IXAudio2Voice */
326 /* XAudio2 2.0's IXAudio2Voice interface. Actually called
327 * IXAudio2Voice in the Mar 2008 DX SDK */
329 object,
330 local
332 interface IXAudio20Voice
334 void GetVoiceDetails([out] XAUDIO27_VOICE_DETAILS* pVoiceDetails);
336 HRESULT SetOutputVoices([in] const XAUDIO23_VOICE_SENDS* pSendList);
338 HRESULT SetEffectChain([in] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
340 HRESULT EnableEffect(
341 [in] UINT32 EffectIndex,
342 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
344 HRESULT DisableEffect(
345 [in] UINT32 EffectIndex,
346 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
348 void GetEffectState(
349 [in] UINT32 EffectIndex,
350 [out] BOOL* pEnabled);
352 HRESULT SetEffectParameters(
353 [in] UINT32 EffectIndex,
354 [in] const void* pParameters,
355 [in] UINT32 ParametersByteSize,
356 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
358 HRESULT GetEffectParameters(
359 [in] UINT32 EffectIndex,
360 [out] void* pParameters,
361 [in] UINT32 ParametersByteSize);
363 HRESULT SetFilterParameters(
364 [in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
365 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
367 void GetFilterParameters([out] XAUDIO2_FILTER_PARAMETERS* pParameters);
369 HRESULT SetVolume(
370 [in] float Volume,
371 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
373 void GetVolume([out] float* pVolume);
375 HRESULT SetChannelVolumes(
376 [in] UINT32 Channels,
377 [in, size_is(Channels)] const float* pVolumes,
378 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
380 void GetChannelVolumes(
381 [in] UINT32 Channels,
382 [out, size_is(Channels)] float* pVolumes);
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);
391 HRESULT GetOutputMatrix(
392 [in] IXAudio2Voice* pDestinationVoice,
393 [in] UINT32 SourceChannels,
394 [in] UINT32 DestinationChannels,
395 [out, size_is(SourceChannels * DestinationChannels)] float* pLevelMatrix);
397 void DestroyVoice();
400 /* XAudio 2.3's IXAudio2Voice */
401 /* XAudio2 2.3's IXAudio2Voice interface. Actually called
402 * IXAudio2Voice in the Nov 2008 DX SDK */
404 object,
405 local
407 interface IXAudio23Voice
409 void GetVoiceDetails([out] XAUDIO27_VOICE_DETAILS* pVoiceDetails);
411 HRESULT SetOutputVoices([in] const XAUDIO23_VOICE_SENDS* pSendList);
413 HRESULT SetEffectChain([in] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
415 HRESULT EnableEffect(
416 [in] UINT32 EffectIndex,
417 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
419 HRESULT DisableEffect(
420 [in] UINT32 EffectIndex,
421 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
423 void GetEffectState(
424 [in] UINT32 EffectIndex,
425 [out] BOOL* pEnabled);
427 HRESULT SetEffectParameters(
428 [in] UINT32 EffectIndex,
429 [in] const void* pParameters,
430 [in] UINT32 ParametersByteSize,
431 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
433 HRESULT GetEffectParameters(
434 [in] UINT32 EffectIndex,
435 [out] void* pParameters,
436 [in] UINT32 ParametersByteSize);
438 HRESULT SetFilterParameters(
439 [in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
440 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
442 void GetFilterParameters([out] XAUDIO2_FILTER_PARAMETERS* pParameters);
444 HRESULT SetVolume(
445 [in] float Volume,
446 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
448 void GetVolume([out] float* pVolume);
450 HRESULT SetChannelVolumes(
451 [in] UINT32 Channels,
452 [in, size_is(Channels)] const float* pVolumes,
453 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
455 void GetChannelVolumes(
456 [in] UINT32 Channels,
457 [out, size_is(Channels)] float* pVolumes);
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);
466 void GetOutputMatrix(
467 [in] IXAudio2Voice* pDestinationVoice,
468 [in] UINT32 SourceChannels,
469 [in] UINT32 DestinationChannels,
470 [out, size_is(SourceChannels * DestinationChannels)] float* pLevelMatrix);
472 void DestroyVoice();
475 /* XAudio 2.7's IXAudio2Voice */
476 /* XAudio2 2.7's IXAudio2Voice interface. Actually called
477 * IXAudio2Voice in the Jun 2010 DX SDK */
479 object,
480 local
482 interface IXAudio27Voice
484 void GetVoiceDetails([out] XAUDIO27_VOICE_DETAILS* pVoiceDetails);
486 HRESULT SetOutputVoices([in] const XAUDIO2_VOICE_SENDS* pSendList);
488 HRESULT SetEffectChain([in] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
490 HRESULT EnableEffect(
491 [in] UINT32 EffectIndex,
492 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
494 HRESULT DisableEffect(
495 [in] UINT32 EffectIndex,
496 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
498 void GetEffectState(
499 [in] UINT32 EffectIndex,
500 [out] BOOL* pEnabled);
502 HRESULT SetEffectParameters(
503 [in] UINT32 EffectIndex,
504 [in] const void* pParameters,
505 [in] UINT32 ParametersByteSize,
506 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
508 HRESULT GetEffectParameters(
509 [in] UINT32 EffectIndex,
510 [out] void* pParameters,
511 [in] UINT32 ParametersByteSize);
513 HRESULT SetFilterParameters(
514 [in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
515 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
517 void GetFilterParameters([out] XAUDIO2_FILTER_PARAMETERS* pParameters);
519 HRESULT SetOutputFilterParameters(
520 [in] IXAudio2Voice* pDestinationVoice,
521 [in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
522 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
524 void GetOutputFilterParameters(
525 [in] IXAudio2Voice* pDestinationVoice,
526 [out] XAUDIO2_FILTER_PARAMETERS* pParameters);
528 HRESULT SetVolume(
529 [in] float Volume,
530 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
532 void GetVolume([out] float* pVolume);
534 HRESULT SetChannelVolumes(
535 [in] UINT32 Channels,
536 [in, size_is(Channels)] const float* pVolumes,
537 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
539 void GetChannelVolumes(
540 [in] UINT32 Channels,
541 [out, size_is(Channels)] float* pVolumes);
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);
550 void GetOutputMatrix(
551 [in] IXAudio2Voice* pDestinationVoice,
552 [in] UINT32 SourceChannels,
553 [in] UINT32 DestinationChannels,
554 [out, size_is(SourceChannels * DestinationChannels)] float* pLevelMatrix);
556 void DestroyVoice();
560 object,
561 local
563 interface IXAudio2Voice
565 void GetVoiceDetails([out] XAUDIO2_VOICE_DETAILS* pVoiceDetails);
567 HRESULT SetOutputVoices([in] const XAUDIO2_VOICE_SENDS* pSendList);
569 HRESULT SetEffectChain([in] const XAUDIO2_EFFECT_CHAIN* pEffectChain);
571 HRESULT EnableEffect(
572 [in] UINT32 EffectIndex,
573 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
575 HRESULT DisableEffect(
576 [in] UINT32 EffectIndex,
577 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
579 void GetEffectState(
580 [in] UINT32 EffectIndex,
581 [out] BOOL* pEnabled);
583 HRESULT SetEffectParameters(
584 [in] UINT32 EffectIndex,
585 [in] const void* pParameters,
586 [in] UINT32 ParametersByteSize,
587 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
589 HRESULT GetEffectParameters(
590 [in] UINT32 EffectIndex,
591 [out] void* pParameters,
592 [in] UINT32 ParametersByteSize);
594 HRESULT SetFilterParameters(
595 [in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
596 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
598 void GetFilterParameters([out] XAUDIO2_FILTER_PARAMETERS* pParameters);
600 HRESULT SetOutputFilterParameters(
601 [in] IXAudio2Voice* pDestinationVoice,
602 [in] const XAUDIO2_FILTER_PARAMETERS* pParameters,
603 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
605 void GetOutputFilterParameters(
606 [in] IXAudio2Voice* pDestinationVoice,
607 [out] XAUDIO2_FILTER_PARAMETERS* pParameters);
609 HRESULT SetVolume(
610 [in] float Volume,
611 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
613 void GetVolume([out] float* pVolume);
615 HRESULT SetChannelVolumes(
616 [in] UINT32 Channels,
617 [in, size_is(Channels)] const float* pVolumes,
618 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
620 void GetChannelVolumes(
621 [in] UINT32 Channels,
622 [out, size_is(Channels)] float* pVolumes);
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);
631 void GetOutputMatrix(
632 [in] IXAudio2Voice* pDestinationVoice,
633 [in] UINT32 SourceChannels,
634 [in] UINT32 DestinationChannels,
635 [out, size_is(SourceChannels * DestinationChannels)] float* pLevelMatrix);
637 void DestroyVoice();
640 typedef struct XAUDIO2_BUFFER
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;
653 typedef struct XAUDIO2_BUFFER_WMA
655 const UINT32* pDecodedPacketCumulativeBytes;
656 UINT32 PacketCount;
657 } XAUDIO2_BUFFER_WMA;
659 typedef struct XAUDIO2_VOICE_STATE
661 void* pCurrentBufferContext;
662 UINT32 BuffersQueued;
663 UINT64 SamplesPlayed;
664 } XAUDIO2_VOICE_STATE;
667 local
669 /* XAudio2 2.0's IXAudio2SourceVoice interface. Actually called
670 * IXAudio2SourceVoice in the Mar 2008 DX SDK */
671 interface IXAudio20SourceVoice : IXAudio20Voice
673 HRESULT Start(
674 [in, defaultvalue(0)] UINT32 Flags,
675 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
677 HRESULT Stop(
678 [in, defaultvalue(0)] UINT32 Flags,
679 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
681 HRESULT SubmitSourceBuffer(
682 [in] const XAUDIO2_BUFFER* pBuffer,
683 [in, defaultvalue(NULL)] const XAUDIO2_BUFFER_WMA* pBufferWMA);
685 HRESULT FlushSourceBuffers();
687 HRESULT Discontinuity();
689 HRESULT ExitLoop([in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
691 void GetState([out] XAUDIO2_VOICE_STATE* pVoiceState);
693 HRESULT SetFrequencyRatio(
694 [in] float Ratio,
695 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
697 void GetFrequencyRatio([out] float* pRatio);
701 local
703 /* XAudio2 2.3's IXAudio2SourceVoice interface. Actually called
704 * IXAudio2SourceVoice in the Nov 2008 DX SDK */
705 interface IXAudio23SourceVoice : IXAudio23Voice
707 HRESULT Start(
708 [in, defaultvalue(0)] UINT32 Flags,
709 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
711 HRESULT Stop(
712 [in, defaultvalue(0)] UINT32 Flags,
713 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
715 HRESULT SubmitSourceBuffer(
716 [in] const XAUDIO2_BUFFER* pBuffer,
717 [in, defaultvalue(NULL)] const XAUDIO2_BUFFER_WMA* pBufferWMA);
719 HRESULT FlushSourceBuffers();
721 HRESULT Discontinuity();
723 HRESULT ExitLoop([in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
725 void GetState([out] XAUDIO2_VOICE_STATE* pVoiceState);
727 HRESULT SetFrequencyRatio(
728 [in] float Ratio,
729 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
731 void GetFrequencyRatio([out] float* pRatio);
735 local
737 /* XAudio2 2.7's IXAudio2SourceVoice interface. Actually called
738 * IXAudio2SourceVoice in the Jun 2010 DX SDK */
739 interface IXAudio27SourceVoice : IXAudio27Voice
741 HRESULT Start(
742 [in, defaultvalue(0)] UINT32 Flags,
743 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
745 HRESULT Stop(
746 [in, defaultvalue(0)] UINT32 Flags,
747 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
749 HRESULT SubmitSourceBuffer(
750 [in] const XAUDIO2_BUFFER* pBuffer,
751 [in, defaultvalue(NULL)] const XAUDIO2_BUFFER_WMA* pBufferWMA);
753 HRESULT FlushSourceBuffers();
755 HRESULT Discontinuity();
757 HRESULT ExitLoop([in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
759 void GetState([out] XAUDIO2_VOICE_STATE* pVoiceState);
761 HRESULT SetFrequencyRatio(
762 [in] float Ratio,
763 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
765 void GetFrequencyRatio([out] float* pRatio);
767 HRESULT SetSourceSampleRate([in] UINT32 NewSourceSampleRate);
771 local
773 /* XAudio2 2.8's IXAudio2SourceVoice interface. */
774 interface IXAudio2SourceVoice : IXAudio2Voice
776 HRESULT Start(
777 [in, defaultvalue(0)] UINT32 Flags,
778 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
780 HRESULT Stop(
781 [in, defaultvalue(0)] UINT32 Flags,
782 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
784 HRESULT SubmitSourceBuffer(
785 [in] const XAUDIO2_BUFFER* pBuffer,
786 [in, defaultvalue(NULL)] const XAUDIO2_BUFFER_WMA* pBufferWMA);
788 HRESULT FlushSourceBuffers();
790 HRESULT Discontinuity();
792 HRESULT ExitLoop([in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
794 void GetState([out] XAUDIO2_VOICE_STATE* pVoiceState, [in, defaultvalue(0)] UINT32 Flags);
796 HRESULT SetFrequencyRatio(
797 [in] float Ratio,
798 [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet);
800 void GetFrequencyRatio([out] float* pRatio);
802 HRESULT SetSourceSampleRate([in] UINT32 NewSourceSampleRate);
806 local
808 /* XAudio2 2.0's IXAudio2SubmixVoice interface. Actually called
809 * IXAudio2SubmixVoice in the Mar 2008 DX SDK */
810 interface IXAudio20SubmixVoice : IXAudio20Voice
815 local
817 /* XAudio2 2.3's IXAudio2SubmixVoice interface. Actually called
818 * IXAudio2SubmixVoice in the Nov 2008 DX SDK */
819 interface IXAudio23SubmixVoice : IXAudio23Voice
824 local
826 /* XAudio2 2.7's IXAudio2SubmixVoice interface. Actually called
827 * IXAudio2SubmixVoice in the Jun 2010 DX SDK */
828 interface IXAudio27SubmixVoice : IXAudio27Voice
833 local
835 interface IXAudio2SubmixVoice : IXAudio2Voice
840 local
842 /* XAudio2 2.0's IXAudio2MasteringVoice interface. Actually called
843 * IXAudio2MasteringVoice in the Mar 2008 DX SDK */
844 interface IXAudio20MasteringVoice : IXAudio20Voice
849 local
851 /* XAudio2 2.3's IXAudio2MasteringVoice interface. Actually called
852 * IXAudio2MasteringVoice in the Nov 2008 DX SDK */
853 interface IXAudio23MasteringVoice : IXAudio23Voice
858 local
860 /* XAudio2 2.7's IXAudio2MasteringVoice interface. Actually called
861 * IXAudio2MasteringVoice in the Jun 2010 DX SDK */
862 interface IXAudio27MasteringVoice : IXAudio27Voice
867 local
869 interface IXAudio2MasteringVoice : IXAudio2Voice
871 /* not present in XAudio2 2.7 */
872 void GetChannelMask([out] DWORD *pChannelMask);
876 object,
877 local
879 interface IXAudio20VoiceCallback
881 void OnVoiceProcessingPassStart();
883 void OnVoiceProcessingPassEnd();
885 void OnStreamEnd();
887 void OnBufferStart([in] void* pBufferContext);
889 void OnBufferEnd([in] void* pBufferContext);
891 void OnLoopEnd([in] void* pBufferContext);
893 void OnVoiceError(
894 [in] void* pBuffercontext,
895 [in] HRESULT Error);
899 object,
900 local
902 interface IXAudio2VoiceCallback
904 void OnVoiceProcessingPassStart([in] UINT32 BytesRequired);
906 void OnVoiceProcessingPassEnd();
908 void OnStreamEnd();
910 void OnBufferStart([in] void* pBufferContext);
912 void OnBufferEnd([in] void* pBufferContext);
914 void OnLoopEnd([in] void* pBufferContext);
916 void OnVoiceError(
917 [in] void* pBuffercontext,
918 [in] HRESULT Error);
921 typedef struct XAUDIO2_DEBUG_CONFIGURATION
923 UINT32 TraceMask;
924 UINT32 BreakMask;
925 BOOL LogThreadID;
926 BOOL LogFileline;
927 BOOL LogFunctionName;
928 BOOL LogTiming;
929 } XAUDIO2_DEBUG_CONFIGURATION;
932 object,
933 uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb), /* all versions before 28 share IID_IXAudio */
935 /* XAudio2 2.0's IXAudio2 interface. Actually called IXAudio2 in the Mar 2008
936 * DX SDK */
937 interface IXAudio20 : IUnknown
939 HRESULT GetDeviceCount([out] UINT32* pCount);
941 HRESULT GetDeviceDetails(
942 [in] UINT32 Index,
943 [out] XAUDIO2_DEVICE_DETAILS* pDeviceDetails);
945 HRESULT Initialize(
946 [in, defaultvalue(0)] UINT32 Flags,
947 [in, defaultvalue(XAUDIO2_DEFAULT_PROCESSOR)] XAUDIO2_PROCESSOR XAudio2Processor);
949 HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
951 void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
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);
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);
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);
979 HRESULT StartEngine();
981 void StopEngine();
983 HRESULT CommitChanges([in] UINT32 OperationSet);
985 void GetPerformanceData([out] XAUDIO20_PERFORMANCE_DATA* pPerfData);
987 [local] void SetDebugConfiguration(
988 [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
989 [in, defaultvalue(NULL)] void* pReserved);
993 object,
994 uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb), /* all versions before 28 share IID_IXAudio */
996 /* XAudio2 2.2's IXAudio2 interface. Actually called IXAudio2 in the Jun 2010
997 * DX SDK */
998 interface IXAudio22 : IUnknown
1000 HRESULT GetDeviceCount([out] UINT32* pCount);
1002 HRESULT GetDeviceDetails(
1003 [in] UINT32 Index,
1004 [out] XAUDIO2_DEVICE_DETAILS* pDeviceDetails);
1006 HRESULT Initialize(
1007 [in, defaultvalue(0)] UINT32 Flags,
1008 [in, defaultvalue(XAUDIO2_DEFAULT_PROCESSOR)] XAUDIO2_PROCESSOR XAudio2Processor);
1010 HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
1012 void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
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);
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);
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);
1040 HRESULT StartEngine();
1042 void StopEngine();
1044 HRESULT CommitChanges([in] UINT32 OperationSet);
1046 void GetPerformanceData([out] XAUDIO22_PERFORMANCE_DATA* pPerfData);
1048 [local] void SetDebugConfiguration(
1049 [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
1050 [in, defaultvalue(NULL)] void* pReserved);
1054 object,
1055 uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb), /* all versions before 28 share IID_IXAudio */
1057 /* XAudio2 2.3's IXAudio2 interface. Actually called IXAudio2 in the Nov 2008
1058 * DX SDK */
1059 interface IXAudio23 : IUnknown
1061 HRESULT GetDeviceCount([out] UINT32* pCount);
1063 HRESULT GetDeviceDetails(
1064 [in] UINT32 Index,
1065 [out] XAUDIO2_DEVICE_DETAILS* pDeviceDetails);
1067 HRESULT Initialize(
1068 [in, defaultvalue(0)] UINT32 Flags,
1069 [in, defaultvalue(XAUDIO2_DEFAULT_PROCESSOR)] XAUDIO2_PROCESSOR XAudio2Processor);
1071 HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
1073 void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
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);
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);
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);
1101 HRESULT StartEngine();
1103 void StopEngine();
1105 HRESULT CommitChanges([in] UINT32 OperationSet);
1107 void GetPerformanceData([out] XAUDIO2_PERFORMANCE_DATA* pPerfData);
1109 [local] void SetDebugConfiguration(
1110 [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
1111 [in, defaultvalue(NULL)] void* pReserved);
1115 object,
1116 uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb),
1118 /* XAudio2 2.7's IXAudio2 interface. Actually called IXAudio2 in the Jun 2010
1119 * DX SDK */
1120 interface IXAudio27 : IUnknown
1122 HRESULT GetDeviceCount([out] UINT32* pCount);
1124 HRESULT GetDeviceDetails(
1125 [in] UINT32 Index,
1126 [out] XAUDIO2_DEVICE_DETAILS* pDeviceDetails);
1128 HRESULT Initialize(
1129 [in, defaultvalue(0)] UINT32 Flags,
1130 [in, defaultvalue(XAUDIO2_DEFAULT_PROCESSOR)] XAUDIO2_PROCESSOR XAudio2Processor);
1132 HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
1134 void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
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);
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);
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);
1162 HRESULT StartEngine();
1164 void StopEngine();
1166 HRESULT CommitChanges([in] UINT32 OperationSet);
1168 void GetPerformanceData([out] XAUDIO2_PERFORMANCE_DATA* pPerfData);
1170 [local] void SetDebugConfiguration(
1171 [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
1172 [in, defaultvalue(NULL)] void* pReserved);
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);")
1179 object,
1180 uuid(2b02e3cf-2e0b-4ec3-be45-1b2a3fe7210d)
1182 /* XAudio2 2.9's IXAudio2 interface. */
1183 interface IXAudio2 : IUnknown
1185 HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
1187 void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback);
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);
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);
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);
1216 HRESULT StartEngine();
1218 void StopEngine();
1220 HRESULT CommitChanges([in] UINT32 OperationSet);
1222 void GetPerformanceData([out] XAUDIO2_PERFORMANCE_DATA* pPerfData);
1224 [local] void SetDebugConfiguration(
1225 [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
1226 [in, defaultvalue(NULL)] void* pReserved);
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;
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);
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)")
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)")
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")
1268 cpp_quote("HRESULT WINAPI XAudio2Create(IXAudio2** pxaudio2, UINT32 flags, XAUDIO2_PROCESSOR processor);")
1270 cpp_quote("#include <poppack.h>")