zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
XAudio2.h
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (c) Microsoft Corporation. All rights reserved.
4  *
5  * File: xaudio2.h
6  * Content: Declarations for the XAudio2 game audio API.
7  *
8  **************************************************************************/
9 
10 #ifndef __XAUDIO2_INCLUDED__
11 #define __XAUDIO2_INCLUDED__
12 
13 
14 /**************************************************************************
15  *
16  * XAudio2 COM object class and interface IDs.
17  *
18  **************************************************************************/
19 
20 #include <comdecl.h> // For DEFINE_CLSID and DEFINE_IID
21 
22 // XAudio 2.0 (March 2008 SDK)
23 //DEFINE_CLSID(XAudio2, fac23f48, 31f5, 45a8, b4, 9b, 52, 25, d6, 14, 01, aa);
24 //DEFINE_CLSID(XAudio2_Debug, fac23f48, 31f5, 45a8, b4, 9b, 52, 25, d6, 14, 01, db);
25 
26 // XAudio 2.1 (June 2008 SDK)
27 //DEFINE_CLSID(XAudio2, e21a7345, eb21, 468e, be, 50, 80, 4d, b9, 7c, f7, 08);
28 //DEFINE_CLSID(XAudio2_Debug, f7a76c21, 53d4, 46bb, ac, 53, 8b, 45, 9c, ae, 46, bd);
29 
30 // XAudio 2.2 (August 2008 SDK)
31 //DEFINE_CLSID(XAudio2, b802058a, 464a, 42db, bc, 10, b6, 50, d6, f2, 58, 6a);
32 //DEFINE_CLSID(XAudio2_Debug, 97dfb7e7, 5161, 4015, 87, a9, c7, 9e, 6a, 19, 52, cc);
33 
34 // XAudio 2.3 (November 2008 SDK)
35 //DEFINE_CLSID(XAudio2, 4c5e637a, 16c7, 4de3, 9c, 46, 5e, d2, 21, 81, 96, 2d);
36 //DEFINE_CLSID(XAudio2_Debug, ef0aa05d, 8075, 4e5d, be, ad, 45, be, 0c, 3c, cb, b3);
37 
38 // XAudio 2.4 (March 2009 SDK)
39 //DEFINE_CLSID(XAudio2, 03219e78, 5bc3, 44d1, b9, 2e, f6, 3d, 89, cc, 65, 26);
40 //DEFINE_CLSID(XAudio2_Debug, 4256535c, 1ea4, 4d4b, 8a, d5, f9, db, 76, 2e, ca, 9e);
41 
42 // XAudio 2.5 (August 2009 SDK)
43 //DEFINE_CLSID(XAudio2, 4c9b6dde, 6809, 46e6, a2, 78, 9b, 6a, 97, 58, 86, 70);
44 //DEFINE_CLSID(XAudio2_Debug, 715bdd1a, aa82, 436b, b0, fa, 6a, ce, a3, 9b, d0, a1);
45 
46 // XAudio 2.6 (February 2010 SDK)
47 //DEFINE_CLSID(XAudio2, 3eda9b49, 2085, 498b, 9b, b2, 39, a6, 77, 84, 93, de);
48 //DEFINE_CLSID(XAudio2_Debug, 47199894, 7cc2, 444d, 98, 73, ce, d2, 56, 2c, c6, 0e);
49 
50 // XAudio 2.7 (June 2010 SDK)
51 DEFINE_CLSID(XAudio2, 5a508685, a254, 4fba, 9b, 82, 9a, 24, b0, 03, 06, af);
52 DEFINE_CLSID(XAudio2_Debug, db05ea35, 0329, 4d4b, a5, 3a, 6d, ea, d0, 3d, 38, 52);
53 DEFINE_IID(IXAudio2, 8bcf1f58, 9fe7, 4583, 8a, c6, e2, ad, c4, 65, c8, bb);
54 
55 
56 // Ignore the rest of this header if only the GUID definitions were requested
57 #ifndef GUID_DEFS_ONLY
58 
59 #ifdef _XBOX
60  #include <xobjbase.h> // Xbox COM declarations (IUnknown, etc)
61 #else
62  #include <objbase.h> // Windows COM declarations
63 #endif
64 
65 #include <sal.h> // Markers for documenting API semantics
66 #include <audiodefs.h> // Basic audio data types and constants
67 #include <xma2defs.h> // Data types and constants for XMA2 audio
68 
69 // All structures defined in this file use tight field packing
70 #pragma pack(push, 1)
71 
72 
73 /**************************************************************************
74  *
75  * XAudio2 constants, flags and error codes.
76  *
77  **************************************************************************/
78 
79 // Numeric boundary values
80 #define XAUDIO2_MAX_BUFFER_BYTES 0x80000000 // Maximum bytes allowed in a source buffer
81 #define XAUDIO2_MAX_QUEUED_BUFFERS 64 // Maximum buffers allowed in a voice queue
82 #define XAUDIO2_MAX_BUFFERS_SYSTEM 2 // Maximum buffers allowed for system threads (Xbox 360 only)
83 #define XAUDIO2_MAX_AUDIO_CHANNELS 64 // Maximum channels in an audio stream
84 #define XAUDIO2_MIN_SAMPLE_RATE 1000 // Minimum audio sample rate supported
85 #define XAUDIO2_MAX_SAMPLE_RATE 200000 // Maximum audio sample rate supported
86 #define XAUDIO2_MAX_VOLUME_LEVEL 16777216.0f // Maximum acceptable volume level (2^24)
87 #define XAUDIO2_MIN_FREQ_RATIO (1/1024.0f) // Minimum SetFrequencyRatio argument
88 #define XAUDIO2_MAX_FREQ_RATIO 1024.0f // Maximum MaxFrequencyRatio argument
89 #define XAUDIO2_DEFAULT_FREQ_RATIO 2.0f // Default MaxFrequencyRatio argument
90 #define XAUDIO2_MAX_FILTER_ONEOVERQ 1.5f // Maximum XAUDIO2_FILTER_PARAMETERS.OneOverQ
91 #define XAUDIO2_MAX_FILTER_FREQUENCY 1.0f // Maximum XAUDIO2_FILTER_PARAMETERS.Frequency
92 #define XAUDIO2_MAX_LOOP_COUNT 254 // Maximum non-infinite XAUDIO2_BUFFER.LoopCount
93 #define XAUDIO2_MAX_INSTANCES 8 // Maximum simultaneous XAudio2 objects on Xbox 360
94 
95 // For XMA voices on Xbox 360 there is an additional restriction on the MaxFrequencyRatio
96 // argument and the voice's sample rate: the product of these numbers cannot exceed 600000
97 // for one-channel voices or 300000 for voices with more than one channel.
98 #define XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MONO 600000
99 #define XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MULTICHANNEL 300000
100 
101 // Numeric values with special meanings
102 #define XAUDIO2_COMMIT_NOW 0 // Used as an OperationSet argument
103 #define XAUDIO2_COMMIT_ALL 0 // Used in IXAudio2::CommitChanges
104 #define XAUDIO2_INVALID_OPSET (UINT32)(-1) // Not allowed for OperationSet arguments
105 #define XAUDIO2_NO_LOOP_REGION 0 // Used in XAUDIO2_BUFFER.LoopCount
106 #define XAUDIO2_LOOP_INFINITE 255 // Used in XAUDIO2_BUFFER.LoopCount
107 #define XAUDIO2_DEFAULT_CHANNELS 0 // Used in CreateMasteringVoice
108 #define XAUDIO2_DEFAULT_SAMPLERATE 0 // Used in CreateMasteringVoice
109 
110 // Flags
111 #define XAUDIO2_DEBUG_ENGINE 0x0001 // Used in XAudio2Create on Windows only
112 #define XAUDIO2_VOICE_NOPITCH 0x0002 // Used in IXAudio2::CreateSourceVoice
113 #define XAUDIO2_VOICE_NOSRC 0x0004 // Used in IXAudio2::CreateSourceVoice
114 #define XAUDIO2_VOICE_USEFILTER 0x0008 // Used in IXAudio2::CreateSource/SubmixVoice
115 #define XAUDIO2_VOICE_MUSIC 0x0010 // Used in IXAudio2::CreateSourceVoice
116 #define XAUDIO2_PLAY_TAILS 0x0020 // Used in IXAudio2SourceVoice::Stop
117 #define XAUDIO2_END_OF_STREAM 0x0040 // Used in XAUDIO2_BUFFER.Flags
118 #define XAUDIO2_SEND_USEFILTER 0x0080 // Used in XAUDIO2_SEND_DESCRIPTOR.Flags
119 
120 // Default parameters for the built-in filter
121 #define XAUDIO2_DEFAULT_FILTER_TYPE LowPassFilter
122 #define XAUDIO2_DEFAULT_FILTER_FREQUENCY XAUDIO2_MAX_FILTER_FREQUENCY
123 #define XAUDIO2_DEFAULT_FILTER_ONEOVERQ 1.0f
124 
125 // Internal XAudio2 constants
126 #ifdef _XBOX
127  #define XAUDIO2_QUANTUM_NUMERATOR 2 // On Xbox 360, XAudio2 processes audio
128  #define XAUDIO2_QUANTUM_DENOMINATOR 375 // in 5.333ms chunks (= 2/375 seconds)
129 #else
130  #define XAUDIO2_QUANTUM_NUMERATOR 1 // On Windows, XAudio2 processes audio
131  #define XAUDIO2_QUANTUM_DENOMINATOR 100 // in 10ms chunks (= 1/100 seconds)
132 #endif
133 #define XAUDIO2_QUANTUM_MS (1000.0f * XAUDIO2_QUANTUM_NUMERATOR / XAUDIO2_QUANTUM_DENOMINATOR)
134 
135 // XAudio2 error codes
136 #define FACILITY_XAUDIO2 0x896
137 #define XAUDIO2_E_INVALID_CALL 0x88960001 // An API call or one of its arguments was illegal
138 #define XAUDIO2_E_XMA_DECODER_ERROR 0x88960002 // The XMA hardware suffered an unrecoverable error
139 #define XAUDIO2_E_XAPO_CREATION_FAILED 0x88960003 // XAudio2 failed to initialize an XAPO effect
140 #define XAUDIO2_E_DEVICE_INVALIDATED 0x88960004 // An audio device became unusable (unplugged, etc)
141 
142 
143 /**************************************************************************
144  *
145  * Forward declarations for the XAudio2 interfaces.
146  *
147  **************************************************************************/
148 
149 #ifdef __cplusplus
150  #define FWD_DECLARE(x) interface x
151 #else
152  #define FWD_DECLARE(x) typedef interface x x
153 #endif
154 
155 FWD_DECLARE(IXAudio2);
156 FWD_DECLARE(IXAudio2Voice);
157 FWD_DECLARE(IXAudio2SourceVoice);
158 FWD_DECLARE(IXAudio2SubmixVoice);
159 FWD_DECLARE(IXAudio2MasteringVoice);
160 FWD_DECLARE(IXAudio2EngineCallback);
161 FWD_DECLARE(IXAudio2VoiceCallback);
162 
163 
164 /**************************************************************************
165  *
166  * XAudio2 structures and enumerations.
167  *
168  **************************************************************************/
169 
170 // Used in IXAudio2::Initialize
171 #ifdef _XBOX
172  typedef enum XAUDIO2_XBOX_HWTHREAD_SPECIFIER
173  {
174  XboxThread0 = 0x01,
175  XboxThread1 = 0x02,
176  XboxThread2 = 0x04,
177  XboxThread3 = 0x08,
178  XboxThread4 = 0x10,
179  XboxThread5 = 0x20,
180  XAUDIO2_ANY_PROCESSOR = XboxThread4,
182  } XAUDIO2_XBOX_HWTHREAD_SPECIFIER, XAUDIO2_PROCESSOR;
183 #else
185  {
186  Processor1 = 0x00000001,
187  Processor2 = 0x00000002,
188  Processor3 = 0x00000004,
189  Processor4 = 0x00000008,
190  Processor5 = 0x00000010,
191  Processor6 = 0x00000020,
192  Processor7 = 0x00000040,
193  Processor8 = 0x00000080,
194  Processor9 = 0x00000100,
195  Processor10 = 0x00000200,
196  Processor11 = 0x00000400,
197  Processor12 = 0x00000800,
198  Processor13 = 0x00001000,
199  Processor14 = 0x00002000,
200  Processor15 = 0x00004000,
201  Processor16 = 0x00008000,
202  Processor17 = 0x00010000,
203  Processor18 = 0x00020000,
204  Processor19 = 0x00040000,
205  Processor20 = 0x00080000,
206  Processor21 = 0x00100000,
207  Processor22 = 0x00200000,
208  Processor23 = 0x00400000,
209  Processor24 = 0x00800000,
210  Processor25 = 0x01000000,
211  Processor26 = 0x02000000,
212  Processor27 = 0x04000000,
213  Processor28 = 0x08000000,
214  Processor29 = 0x10000000,
215  Processor30 = 0x20000000,
216  Processor31 = 0x40000000,
217  Processor32 = 0x80000000,
218  XAUDIO2_ANY_PROCESSOR = 0xffffffff,
221 #endif
222 
223 // Used in XAUDIO2_DEVICE_DETAILS below to describe the types of applications
224 // that the user has specified each device as a default for. 0 means that the
225 // device isn't the default for any role.
227 {
236 
237 // Returned by IXAudio2::GetDeviceDetails
239 {
240  WCHAR DeviceID[256]; // String identifier for the audio device.
241  WCHAR DisplayName[256]; // Friendly name suitable for display to a human.
242  XAUDIO2_DEVICE_ROLE Role; // Roles that the device should be used for.
243  WAVEFORMATEXTENSIBLE OutputFormat; // The device's native PCM audio output format.
245 
246 // Returned by IXAudio2Voice::GetVoiceDetails
247 typedef struct XAUDIO2_VOICE_DETAILS
248 {
249  UINT32 CreationFlags; // Flags the voice was created with.
250  UINT32 InputChannels; // Channels in the voice's input audio.
251  UINT32 InputSampleRate; // Sample rate of the voice's input audio.
253 
254 // Used in XAUDIO2_VOICE_SENDS below
256 {
257  UINT32 Flags; // Either 0 or XAUDIO2_SEND_USEFILTER.
258  IXAudio2Voice* pOutputVoice; // This send's destination voice.
260 
261 // Used in the voice creation functions and in IXAudio2Voice::SetOutputVoices
262 typedef struct XAUDIO2_VOICE_SENDS
263 {
264  UINT32 SendCount; // Number of sends from this voice.
265  XAUDIO2_SEND_DESCRIPTOR* pSends; // Array of SendCount send descriptors.
267 
268 // Used in XAUDIO2_EFFECT_CHAIN below
270 {
271  IUnknown* pEffect; // Pointer to the effect object's IUnknown interface.
272  BOOL InitialState; // TRUE if the effect should begin in the enabled state.
273  UINT32 OutputChannels; // How many output channels the effect should produce.
275 
276 // Used in the voice creation functions and in IXAudio2Voice::SetEffectChain
277 typedef struct XAUDIO2_EFFECT_CHAIN
278 {
279  UINT32 EffectCount; // Number of effects in this voice's effect chain.
280  XAUDIO2_EFFECT_DESCRIPTOR* pEffectDescriptors; // Array of effect descriptors.
282 
283 // Used in XAUDIO2_FILTER_PARAMETERS below
285 {
286  LowPassFilter, // Attenuates frequencies above the cutoff frequency.
287  BandPassFilter, // Attenuates frequencies outside a given range.
288  HighPassFilter, // Attenuates frequencies below the cutoff frequency.
289  NotchFilter // Attenuates frequencies inside a given range.
291 
292 // Used in IXAudio2Voice::Set/GetFilterParameters and Set/GetOutputFilterParameters
294 {
295  XAUDIO2_FILTER_TYPE Type; // Low-pass, band-pass or high-pass.
296  float Frequency; // Radian frequency (2 * sin(pi*CutoffFrequency/SampleRate));
297  // must be >= 0 and <= XAUDIO2_MAX_FILTER_FREQUENCY
298  // (giving a maximum CutoffFrequency of SampleRate/6).
299  float OneOverQ; // Reciprocal of the filter's quality factor Q;
300  // must be > 0 and <= XAUDIO2_MAX_FILTER_ONEOVERQ.
302 
303 // Used in IXAudio2SourceVoice::SubmitSourceBuffer
304 typedef struct XAUDIO2_BUFFER
305 {
306  UINT32 Flags; // Either 0 or XAUDIO2_END_OF_STREAM.
307  UINT32 AudioBytes; // Size of the audio data buffer in bytes.
308  const BYTE* pAudioData; // Pointer to the audio data buffer.
309  UINT32 PlayBegin; // First sample in this buffer to be played.
310  UINT32 PlayLength; // Length of the region to be played in samples,
311  // or 0 to play the whole buffer.
312  UINT32 LoopBegin; // First sample of the region to be looped.
313  UINT32 LoopLength; // Length of the desired loop region in samples,
314  // or 0 to loop the entire buffer.
315  UINT32 LoopCount; // Number of times to repeat the loop region,
316  // or XAUDIO2_LOOP_INFINITE to loop forever.
317  void* pContext; // Context value to be passed back in callbacks.
319 
320 // Used in IXAudio2SourceVoice::SubmitSourceBuffer when submitting XWMA data.
321 // NOTE: If an XWMA sound is submitted in more than one buffer, each buffer's
322 // pDecodedPacketCumulativeBytes[PacketCount-1] value must be subtracted from
323 // all the entries in the next buffer's pDecodedPacketCumulativeBytes array.
324 // And whether a sound is submitted in more than one buffer or not, the final
325 // buffer of the sound should use the XAUDIO2_END_OF_STREAM flag, or else the
326 // client must call IXAudio2SourceVoice::Discontinuity after submitting it.
327 typedef struct XAUDIO2_BUFFER_WMA
328 {
329  const UINT32* pDecodedPacketCumulativeBytes; // Decoded packet's cumulative size array.
330  // Each element is the number of bytes accumulated
331  // when the corresponding XWMA packet is decoded in
332  // order. The array must have PacketCount elements.
333  UINT32 PacketCount; // Number of XWMA packets submitted. Must be >= 1 and
334  // divide evenly into XAUDIO2_BUFFER.AudioBytes.
336 
337 // Returned by IXAudio2SourceVoice::GetState
338 typedef struct XAUDIO2_VOICE_STATE
339 {
340  void* pCurrentBufferContext; // The pContext value provided in the XAUDIO2_BUFFER
341  // that is currently being processed, or NULL if
342  // there are no buffers in the queue.
343  UINT32 BuffersQueued; // Number of buffers currently queued on the voice
344  // (including the one that is being processed).
345  UINT64 SamplesPlayed; // Total number of samples produced by the voice since
346  // it began processing the current audio stream.
348 
349 // Returned by IXAudio2::GetPerformanceData
351 {
352  // CPU usage information
353  UINT64 AudioCyclesSinceLastQuery; // CPU cycles spent on audio processing since the
354  // last call to StartEngine or GetPerformanceData.
355  UINT64 TotalCyclesSinceLastQuery; // Total CPU cycles elapsed since the last call
356  // (only counts the CPU XAudio2 is running on).
357  UINT32 MinimumCyclesPerQuantum; // Fewest CPU cycles spent processing any one
358  // audio quantum since the last call.
359  UINT32 MaximumCyclesPerQuantum; // Most CPU cycles spent processing any one
360  // audio quantum since the last call.
361 
362  // Memory usage information
363  UINT32 MemoryUsageInBytes; // Total heap space currently in use.
364 
365  // Audio latency and glitching information
366  UINT32 CurrentLatencyInSamples; // Minimum delay from when a sample is read from a
367  // source buffer to when it reaches the speakers.
368  UINT32 GlitchesSinceEngineStarted; // Audio dropouts since the engine was started.
369 
370  // Data about XAudio2's current workload
371  UINT32 ActiveSourceVoiceCount; // Source voices currently playing.
372  UINT32 TotalSourceVoiceCount; // Source voices currently existing.
373  UINT32 ActiveSubmixVoiceCount; // Submix voices currently playing/existing.
374 
375  UINT32 ActiveResamplerCount; // Resample xAPOs currently active.
376  UINT32 ActiveMatrixMixCount; // MatrixMix xAPOs currently active.
377 
378  // Usage of the hardware XMA decoder (Xbox 360 only)
379  UINT32 ActiveXmaSourceVoices; // Number of source voices decoding XMA data.
380  UINT32 ActiveXmaStreams; // A voice can use more than one XMA stream.
382 
383 // Used in IXAudio2::SetDebugConfiguration
385 {
386  UINT32 TraceMask; // Bitmap of enabled debug message types.
387  UINT32 BreakMask; // Message types that will break into the debugger.
388  BOOL LogThreadID; // Whether to log the thread ID with each message.
389  BOOL LogFileline; // Whether to log the source file and line number.
390  BOOL LogFunctionName; // Whether to log the function name.
391  BOOL LogTiming; // Whether to log message timestamps.
393 
394 // Values for the TraceMask and BreakMask bitmaps. Only ERRORS and WARNINGS
395 // are valid in BreakMask. WARNINGS implies ERRORS, DETAIL implies INFO, and
396 // FUNC_CALLS implies API_CALLS. By default, TraceMask is ERRORS and WARNINGS
397 // and all the other settings are zero.
398 #define XAUDIO2_LOG_ERRORS 0x0001 // For handled errors with serious effects.
399 #define XAUDIO2_LOG_WARNINGS 0x0002 // For handled errors that may be recoverable.
400 #define XAUDIO2_LOG_INFO 0x0004 // Informational chit-chat (e.g. state changes).
401 #define XAUDIO2_LOG_DETAIL 0x0008 // More detailed chit-chat.
402 #define XAUDIO2_LOG_API_CALLS 0x0010 // Public API function entries and exits.
403 #define XAUDIO2_LOG_FUNC_CALLS 0x0020 // Internal function entries and exits.
404 #define XAUDIO2_LOG_TIMING 0x0040 // Delays detected and other timing data.
405 #define XAUDIO2_LOG_LOCKS 0x0080 // Usage of critical sections and mutexes.
406 #define XAUDIO2_LOG_MEMORY 0x0100 // Memory heap usage information.
407 #define XAUDIO2_LOG_STREAMING 0x1000 // Audio streaming information.
408 
409 
410 /**************************************************************************
411  *
412  * IXAudio2: Top-level XAudio2 COM interface.
413  *
414  **************************************************************************/
415 
416 // Use default arguments if compiling as C++
417 #ifdef __cplusplus
418  #define X2DEFAULT(x) =x
419 #else
420  #define X2DEFAULT(x)
421 #endif
422 
423 #undef INTERFACE
424 #define INTERFACE IXAudio2
425 DECLARE_INTERFACE_(IXAudio2, IUnknown)
426 {
427  // NAME: IXAudio2::QueryInterface
428  // DESCRIPTION: Queries for a given COM interface on the XAudio2 object.
429  // Only IID_IUnknown and IID_IXAudio2 are supported.
430  //
431  // ARGUMENTS:
432  // riid - IID of the interface to be obtained.
433  // ppvInterface - Returns a pointer to the requested interface.
434  //
435  STDMETHOD(QueryInterface) (THIS_ REFIID riid, __deref_out void** ppvInterface) PURE;
436 
437  // NAME: IXAudio2::AddRef
438  // DESCRIPTION: Adds a reference to the XAudio2 object.
439  //
440  STDMETHOD_(ULONG, AddRef) (THIS) PURE;
441 
442  // NAME: IXAudio2::Release
443  // DESCRIPTION: Releases a reference to the XAudio2 object.
444  //
445  STDMETHOD_(ULONG, Release) (THIS) PURE;
446 
447  // NAME: IXAudio2::GetDeviceCount
448  // DESCRIPTION: Returns the number of audio output devices available.
449  //
450  // ARGUMENTS:
451  // pCount - Returns the device count.
452  //
453  STDMETHOD(GetDeviceCount) (THIS_ __out UINT32* pCount) PURE;
454 
455  // NAME: IXAudio2::GetDeviceDetails
456  // DESCRIPTION: Returns information about the device with the given index.
457  //
458  // ARGUMENTS:
459  // Index - Index of the device to be queried.
460  // pDeviceDetails - Returns the device details.
461  //
462  STDMETHOD(GetDeviceDetails) (THIS_ UINT32 Index, __out XAUDIO2_DEVICE_DETAILS* pDeviceDetails) PURE;
463 
464  // NAME: IXAudio2::Initialize
465  // DESCRIPTION: Sets global XAudio2 parameters and prepares it for use.
466  //
467  // ARGUMENTS:
468  // Flags - Flags specifying the XAudio2 object's behavior. Currently unused.
469  // XAudio2Processor - An XAUDIO2_PROCESSOR enumeration value that specifies
470  // the hardware thread (Xbox) or processor (Windows) that XAudio2 will use.
471  // The enumeration values are platform-specific; platform-independent code
472  // can use XAUDIO2_DEFAULT_PROCESSOR to use the default on each platform.
473  //
474  STDMETHOD(Initialize) (THIS_ UINT32 Flags X2DEFAULT(0),
475  XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR)) PURE;
476 
477  // NAME: IXAudio2::RegisterForCallbacks
478  // DESCRIPTION: Adds a new client to receive XAudio2's engine callbacks.
479  //
480  // ARGUMENTS:
481  // pCallback - Callback interface to be called during each processing pass.
482  //
483  STDMETHOD(RegisterForCallbacks) (__in IXAudio2EngineCallback* pCallback) PURE;
484 
485  // NAME: IXAudio2::UnregisterForCallbacks
486  // DESCRIPTION: Removes an existing receiver of XAudio2 engine callbacks.
487  //
488  // ARGUMENTS:
489  // pCallback - Previously registered callback interface to be removed.
490  //
491  STDMETHOD_(void, UnregisterForCallbacks) (__in IXAudio2EngineCallback* pCallback) PURE;
492 
493  // NAME: IXAudio2::CreateSourceVoice
494  // DESCRIPTION: Creates and configures a source voice.
495  //
496  // ARGUMENTS:
497  // ppSourceVoice - Returns the new object's IXAudio2SourceVoice interface.
498  // pSourceFormat - Format of the audio that will be fed to the voice.
499  // Flags - XAUDIO2_VOICE flags specifying the source voice's behavior.
500  // MaxFrequencyRatio - Maximum SetFrequencyRatio argument to be allowed.
501  // pCallback - Optional pointer to a client-provided callback interface.
502  // pSendList - Optional list of voices this voice should send audio to.
503  // pEffectChain - Optional list of effects to apply to the audio data.
504  //
505  STDMETHOD(CreateSourceVoice) (THIS_ __deref_out IXAudio2SourceVoice** ppSourceVoice,
506  __in const WAVEFORMATEX* pSourceFormat,
507  UINT32 Flags X2DEFAULT(0),
508  float MaxFrequencyRatio X2DEFAULT(XAUDIO2_DEFAULT_FREQ_RATIO),
509  __in_opt IXAudio2VoiceCallback* pCallback X2DEFAULT(NULL),
510  __in_opt const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL),
511  __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE;
512 
513  // NAME: IXAudio2::CreateSubmixVoice
514  // DESCRIPTION: Creates and configures a submix voice.
515  //
516  // ARGUMENTS:
517  // ppSubmixVoice - Returns the new object's IXAudio2SubmixVoice interface.
518  // InputChannels - Number of channels in this voice's input audio data.
519  // InputSampleRate - Sample rate of this voice's input audio data.
520  // Flags - XAUDIO2_VOICE flags specifying the submix voice's behavior.
521  // ProcessingStage - Arbitrary number that determines the processing order.
522  // pSendList - Optional list of voices this voice should send audio to.
523  // pEffectChain - Optional list of effects to apply to the audio data.
524  //
525  STDMETHOD(CreateSubmixVoice) (THIS_ __deref_out IXAudio2SubmixVoice** ppSubmixVoice,
526  UINT32 InputChannels, UINT32 InputSampleRate,
527  UINT32 Flags X2DEFAULT(0), UINT32 ProcessingStage X2DEFAULT(0),
528  __in_opt const XAUDIO2_VOICE_SENDS* pSendList X2DEFAULT(NULL),
529  __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE;
530 
531 
532  // NAME: IXAudio2::CreateMasteringVoice
533  // DESCRIPTION: Creates and configures a mastering voice.
534  //
535  // ARGUMENTS:
536  // ppMasteringVoice - Returns the new object's IXAudio2MasteringVoice interface.
537  // InputChannels - Number of channels in this voice's input audio data.
538  // InputSampleRate - Sample rate of this voice's input audio data.
539  // Flags - XAUDIO2_VOICE flags specifying the mastering voice's behavior.
540  // DeviceIndex - Identifier of the device to receive the output audio.
541  // pEffectChain - Optional list of effects to apply to the audio data.
542  //
543  STDMETHOD(CreateMasteringVoice) (THIS_ __deref_out IXAudio2MasteringVoice** ppMasteringVoice,
544  UINT32 InputChannels X2DEFAULT(XAUDIO2_DEFAULT_CHANNELS),
545  UINT32 InputSampleRate X2DEFAULT(XAUDIO2_DEFAULT_SAMPLERATE),
546  UINT32 Flags X2DEFAULT(0), UINT32 DeviceIndex X2DEFAULT(0),
547  __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL)) PURE;
548 
549  // NAME: IXAudio2::StartEngine
550  // DESCRIPTION: Creates and starts the audio processing thread.
551  //
552  STDMETHOD(StartEngine) (THIS) PURE;
553 
554  // NAME: IXAudio2::StopEngine
555  // DESCRIPTION: Stops and destroys the audio processing thread.
556  //
557  STDMETHOD_(void, StopEngine) (THIS) PURE;
558 
559  // NAME: IXAudio2::CommitChanges
560  // DESCRIPTION: Atomically applies a set of operations previously tagged
561  // with a given identifier.
562  //
563  // ARGUMENTS:
564  // OperationSet - Identifier of the set of operations to be applied.
565  //
566  STDMETHOD(CommitChanges) (THIS_ UINT32 OperationSet) PURE;
567 
568  // NAME: IXAudio2::GetPerformanceData
569  // DESCRIPTION: Returns current resource usage details: memory, CPU, etc.
570  //
571  // ARGUMENTS:
572  // pPerfData - Returns the performance data structure.
573  //
574  STDMETHOD_(void, GetPerformanceData) (THIS_ __out XAUDIO2_PERFORMANCE_DATA* pPerfData) PURE;
575 
576  // NAME: IXAudio2::SetDebugConfiguration
577  // DESCRIPTION: Configures XAudio2's debug output (in debug builds only).
578  //
579  // ARGUMENTS:
580  // pDebugConfiguration - Structure describing the debug output behavior.
581  // pReserved - Optional parameter; must be NULL.
582  //
583  STDMETHOD_(void, SetDebugConfiguration) (THIS_ __in_opt const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration,
584  __in_opt __reserved void* pReserved X2DEFAULT(NULL)) PURE;
585 };
586 
587 
588 /**************************************************************************
589  *
590  * IXAudio2Voice: Base voice management interface.
591  *
592  **************************************************************************/
593 
594 #undef INTERFACE
595 #define INTERFACE IXAudio2Voice
596 DECLARE_INTERFACE(IXAudio2Voice)
597 {
598  // These methods are declared in a macro so that the same declarations
599  // can be used in the derived voice types (IXAudio2SourceVoice, etc).
600 
601  #define Declare_IXAudio2Voice_Methods() \
602  \
603  /* NAME: IXAudio2Voice::GetVoiceDetails
604  // DESCRIPTION: Returns the basic characteristics of this voice.
605  //
606  // ARGUMENTS:
607  // pVoiceDetails - Returns the voice's details.
608  */\
609  STDMETHOD_(void, GetVoiceDetails) (THIS_ __out XAUDIO2_VOICE_DETAILS* pVoiceDetails) PURE; \
610  \
611  /* NAME: IXAudio2Voice::SetOutputVoices
612  // DESCRIPTION: Replaces the set of submix/mastering voices that receive
613  // this voice's output.
614  //
615  // ARGUMENTS:
616  // pSendList - Optional list of voices this voice should send audio to.
617  */\
618  STDMETHOD(SetOutputVoices) (THIS_ __in_opt const XAUDIO2_VOICE_SENDS* pSendList) PURE; \
619  \
620  /* NAME: IXAudio2Voice::SetEffectChain
621  // DESCRIPTION: Replaces this voice's current effect chain with a new one.
622  //
623  // ARGUMENTS:
624  // pEffectChain - Structure describing the new effect chain to be used.
625  */\
626  STDMETHOD(SetEffectChain) (THIS_ __in_opt const XAUDIO2_EFFECT_CHAIN* pEffectChain) PURE; \
627  \
628  /* NAME: IXAudio2Voice::EnableEffect
629  // DESCRIPTION: Enables an effect in this voice's effect chain.
630  //
631  // ARGUMENTS:
632  // EffectIndex - Index of an effect within this voice's effect chain.
633  // OperationSet - Used to identify this call as part of a deferred batch.
634  */\
635  STDMETHOD(EnableEffect) (THIS_ UINT32 EffectIndex, \
636  UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
637  \
638  /* NAME: IXAudio2Voice::DisableEffect
639  // DESCRIPTION: Disables an effect in this voice's effect chain.
640  //
641  // ARGUMENTS:
642  // EffectIndex - Index of an effect within this voice's effect chain.
643  // OperationSet - Used to identify this call as part of a deferred batch.
644  */\
645  STDMETHOD(DisableEffect) (THIS_ UINT32 EffectIndex, \
646  UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
647  \
648  /* NAME: IXAudio2Voice::GetEffectState
649  // DESCRIPTION: Returns the running state of an effect.
650  //
651  // ARGUMENTS:
652  // EffectIndex - Index of an effect within this voice's effect chain.
653  // pEnabled - Returns the enabled/disabled state of the given effect.
654  */\
655  STDMETHOD_(void, GetEffectState) (THIS_ UINT32 EffectIndex, __out BOOL* pEnabled) PURE; \
656  \
657  /* NAME: IXAudio2Voice::SetEffectParameters
658  // DESCRIPTION: Sets effect-specific parameters.
659  //
660  // REMARKS: Unlike IXAPOParameters::SetParameters, this method may
661  // be called from any thread. XAudio2 implements
662  // appropriate synchronization to copy the parameters to the
663  // realtime audio processing thread.
664  //
665  // ARGUMENTS:
666  // EffectIndex - Index of an effect within this voice's effect chain.
667  // pParameters - Pointer to an effect-specific parameters block.
668  // ParametersByteSize - Size of the pParameters array in bytes.
669  // OperationSet - Used to identify this call as part of a deferred batch.
670  */\
671  STDMETHOD(SetEffectParameters) (THIS_ UINT32 EffectIndex, \
672  __in_bcount(ParametersByteSize) const void* pParameters, \
673  UINT32 ParametersByteSize, \
674  UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
675  \
676  /* NAME: IXAudio2Voice::GetEffectParameters
677  // DESCRIPTION: Obtains the current effect-specific parameters.
678  //
679  // ARGUMENTS:
680  // EffectIndex - Index of an effect within this voice's effect chain.
681  // pParameters - Returns the current values of the effect-specific parameters.
682  // ParametersByteSize - Size of the pParameters array in bytes.
683  */\
684  STDMETHOD(GetEffectParameters) (THIS_ UINT32 EffectIndex, \
685  __out_bcount(ParametersByteSize) void* pParameters, \
686  UINT32 ParametersByteSize) PURE; \
687  \
688  /* NAME: IXAudio2Voice::SetFilterParameters
689  // DESCRIPTION: Sets this voice's filter parameters.
690  //
691  // ARGUMENTS:
692  // pParameters - Pointer to the filter's parameter structure.
693  // OperationSet - Used to identify this call as part of a deferred batch.
694  */\
695  STDMETHOD(SetFilterParameters) (THIS_ __in const XAUDIO2_FILTER_PARAMETERS* pParameters, \
696  UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
697  \
698  /* NAME: IXAudio2Voice::GetFilterParameters
699  // DESCRIPTION: Returns this voice's current filter parameters.
700  //
701  // ARGUMENTS:
702  // pParameters - Returns the filter parameters.
703  */\
704  STDMETHOD_(void, GetFilterParameters) (THIS_ __out XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \
705  \
706  /* NAME: IXAudio2Voice::SetOutputFilterParameters
707  // DESCRIPTION: Sets the filter parameters on one of this voice's sends.
708  //
709  // ARGUMENTS:
710  // pDestinationVoice - Destination voice of the send whose filter parameters will be set.
711  // pParameters - Pointer to the filter's parameter structure.
712  // OperationSet - Used to identify this call as part of a deferred batch.
713  */\
714  STDMETHOD(SetOutputFilterParameters) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \
715  __in const XAUDIO2_FILTER_PARAMETERS* pParameters, \
716  UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
717  \
718  /* NAME: IXAudio2Voice::GetOutputFilterParameters
719  // DESCRIPTION: Returns the filter parameters from one of this voice's sends.
720  //
721  // ARGUMENTS:
722  // pDestinationVoice - Destination voice of the send whose filter parameters will be read.
723  // pParameters - Returns the filter parameters.
724  */\
725  STDMETHOD_(void, GetOutputFilterParameters) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \
726  __out XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \
727  \
728  /* NAME: IXAudio2Voice::SetVolume
729  // DESCRIPTION: Sets this voice's overall volume level.
730  //
731  // ARGUMENTS:
732  // Volume - New overall volume level to be used, as an amplitude factor.
733  // OperationSet - Used to identify this call as part of a deferred batch.
734  */\
735  STDMETHOD(SetVolume) (THIS_ float Volume, \
736  UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
737  \
738  /* NAME: IXAudio2Voice::GetVolume
739  // DESCRIPTION: Obtains this voice's current overall volume level.
740  //
741  // ARGUMENTS:
742  // pVolume: Returns the voice's current overall volume level.
743  */\
744  STDMETHOD_(void, GetVolume) (THIS_ __out float* pVolume) PURE; \
745  \
746  /* NAME: IXAudio2Voice::SetChannelVolumes
747  // DESCRIPTION: Sets this voice's per-channel volume levels.
748  //
749  // ARGUMENTS:
750  // Channels - Used to confirm the voice's channel count.
751  // pVolumes - Array of per-channel volume levels to be used.
752  // OperationSet - Used to identify this call as part of a deferred batch.
753  */\
754  STDMETHOD(SetChannelVolumes) (THIS_ UINT32 Channels, __in_ecount(Channels) const float* pVolumes, \
755  UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
756  \
757  /* NAME: IXAudio2Voice::GetChannelVolumes
758  // DESCRIPTION: Returns this voice's current per-channel volume levels.
759  //
760  // ARGUMENTS:
761  // Channels - Used to confirm the voice's channel count.
762  // pVolumes - Returns an array of the current per-channel volume levels.
763  */\
764  STDMETHOD_(void, GetChannelVolumes) (THIS_ UINT32 Channels, __out_ecount(Channels) float* pVolumes) PURE; \
765  \
766  /* NAME: IXAudio2Voice::SetOutputMatrix
767  // DESCRIPTION: Sets the volume levels used to mix from each channel of this
768  // voice's output audio to each channel of a given destination
769  // voice's input audio.
770  //
771  // ARGUMENTS:
772  // pDestinationVoice - The destination voice whose mix matrix to change.
773  // SourceChannels - Used to confirm this voice's output channel count
774  // (the number of channels produced by the last effect in the chain).
775  // DestinationChannels - Confirms the destination voice's input channels.
776  // pLevelMatrix - Array of [SourceChannels * DestinationChannels] send
777  // levels. The level used to send from source channel S to destination
778  // channel D should be in pLevelMatrix[S + SourceChannels * D].
779  // OperationSet - Used to identify this call as part of a deferred batch.
780  */\
781  STDMETHOD(SetOutputMatrix) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \
782  UINT32 SourceChannels, UINT32 DestinationChannels, \
783  __in_ecount(SourceChannels * DestinationChannels) const float* pLevelMatrix, \
784  UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \
785  \
786  /* NAME: IXAudio2Voice::GetOutputMatrix
787  // DESCRIPTION: Obtains the volume levels used to send each channel of this
788  // voice's output audio to each channel of a given destination
789  // voice's input audio.
790  //
791  // ARGUMENTS:
792  // pDestinationVoice - The destination voice whose mix matrix to obtain.
793  // SourceChannels - Used to confirm this voice's output channel count
794  // (the number of channels produced by the last effect in the chain).
795  // DestinationChannels - Confirms the destination voice's input channels.
796  // pLevelMatrix - Array of send levels, as above.
797  */\
798  STDMETHOD_(void, GetOutputMatrix) (THIS_ __in_opt IXAudio2Voice* pDestinationVoice, \
799  UINT32 SourceChannels, UINT32 DestinationChannels, \
800  __out_ecount(SourceChannels * DestinationChannels) float* pLevelMatrix) PURE; \
801  \
802  /* NAME: IXAudio2Voice::DestroyVoice
803  // DESCRIPTION: Destroys this voice, stopping it if necessary and removing
804  // it from the XAudio2 graph.
805  */\
806  STDMETHOD_(void, DestroyVoice) (THIS) PURE
807 
809 };
810 
811 
812 /**************************************************************************
813  *
814  * IXAudio2SourceVoice: Source voice management interface.
815  *
816  **************************************************************************/
817 
818 #undef INTERFACE
819 #define INTERFACE IXAudio2SourceVoice
820 DECLARE_INTERFACE_(IXAudio2SourceVoice, IXAudio2Voice)
821 {
822  // Methods from IXAudio2Voice base interface
824 
825  // NAME: IXAudio2SourceVoice::Start
826  // DESCRIPTION: Makes this voice start consuming and processing audio.
827  //
828  // ARGUMENTS:
829  // Flags - Flags controlling how the voice should be started.
830  // OperationSet - Used to identify this call as part of a deferred batch.
831  //
832  STDMETHOD(Start) (THIS_ UINT32 Flags X2DEFAULT(0), UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
833 
834  // NAME: IXAudio2SourceVoice::Stop
835  // DESCRIPTION: Makes this voice stop consuming audio.
836  //
837  // ARGUMENTS:
838  // Flags - Flags controlling how the voice should be stopped.
839  // OperationSet - Used to identify this call as part of a deferred batch.
840  //
841  STDMETHOD(Stop) (THIS_ UINT32 Flags X2DEFAULT(0), UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
842 
843  // NAME: IXAudio2SourceVoice::SubmitSourceBuffer
844  // DESCRIPTION: Adds a new audio buffer to this voice's input queue.
845  //
846  // ARGUMENTS:
847  // pBuffer - Pointer to the buffer structure to be queued.
848  // pBufferWMA - Additional structure used only when submitting XWMA data.
849  //
850  STDMETHOD(SubmitSourceBuffer) (THIS_ __in const XAUDIO2_BUFFER* pBuffer, __in_opt const XAUDIO2_BUFFER_WMA* pBufferWMA X2DEFAULT(NULL)) PURE;
851 
852  // NAME: IXAudio2SourceVoice::FlushSourceBuffers
853  // DESCRIPTION: Removes all pending audio buffers from this voice's queue.
854  //
855  STDMETHOD(FlushSourceBuffers) (THIS) PURE;
856 
857  // NAME: IXAudio2SourceVoice::Discontinuity
858  // DESCRIPTION: Notifies the voice of an intentional break in the stream of
859  // audio buffers (e.g. the end of a sound), to prevent XAudio2
860  // from interpreting an empty buffer queue as a glitch.
861  //
862  STDMETHOD(Discontinuity) (THIS) PURE;
863 
864  // NAME: IXAudio2SourceVoice::ExitLoop
865  // DESCRIPTION: Breaks out of the current loop when its end is reached.
866  //
867  // ARGUMENTS:
868  // OperationSet - Used to identify this call as part of a deferred batch.
869  //
870  STDMETHOD(ExitLoop) (THIS_ UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
871 
872  // NAME: IXAudio2SourceVoice::GetState
873  // DESCRIPTION: Returns the number of buffers currently queued on this voice,
874  // the pContext value associated with the currently processing
875  // buffer (if any), and other voice state information.
876  //
877  // ARGUMENTS:
878  // pVoiceState - Returns the state information.
879  //
880  STDMETHOD_(void, GetState) (THIS_ __out XAUDIO2_VOICE_STATE* pVoiceState) PURE;
881 
882  // NAME: IXAudio2SourceVoice::SetFrequencyRatio
883  // DESCRIPTION: Sets this voice's frequency adjustment, i.e. its pitch.
884  //
885  // ARGUMENTS:
886  // Ratio - Frequency change, expressed as source frequency / target frequency.
887  // OperationSet - Used to identify this call as part of a deferred batch.
888  //
889  STDMETHOD(SetFrequencyRatio) (THIS_ float Ratio,
890  UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE;
891 
892  // NAME: IXAudio2SourceVoice::GetFrequencyRatio
893  // DESCRIPTION: Returns this voice's current frequency adjustment ratio.
894  //
895  // ARGUMENTS:
896  // pRatio - Returns the frequency adjustment.
897  //
898  STDMETHOD_(void, GetFrequencyRatio) (THIS_ __out float* pRatio) PURE;
899 
900  // NAME: IXAudio2SourceVoice::SetSourceSampleRate
901  // DESCRIPTION: Reconfigures this voice to treat its source data as being
902  // at a different sample rate than the original one specified
903  // in CreateSourceVoice's pSourceFormat argument.
904  //
905  // ARGUMENTS:
906  // UINT32 - The intended sample rate of further submitted source data.
907  //
908  STDMETHOD(SetSourceSampleRate) (THIS_ UINT32 NewSourceSampleRate) PURE;
909 };
910 
911 
912 /**************************************************************************
913  *
914  * IXAudio2SubmixVoice: Submixing voice management interface.
915  *
916  **************************************************************************/
917 
918 #undef INTERFACE
919 #define INTERFACE IXAudio2SubmixVoice
920 DECLARE_INTERFACE_(IXAudio2SubmixVoice, IXAudio2Voice)
921 {
922  // Methods from IXAudio2Voice base interface
924 
925  // There are currently no methods specific to submix voices.
926 };
927 
928 
929 /**************************************************************************
930  *
931  * IXAudio2MasteringVoice: Mastering voice management interface.
932  *
933  **************************************************************************/
934 
935 #undef INTERFACE
936 #define INTERFACE IXAudio2MasteringVoice
937 DECLARE_INTERFACE_(IXAudio2MasteringVoice, IXAudio2Voice)
938 {
939  // Methods from IXAudio2Voice base interface
941 
942  // There are currently no methods specific to mastering voices.
943 };
944 
945 
946 /**************************************************************************
947  *
948  * IXAudio2EngineCallback: Client notification interface for engine events.
949  *
950  * REMARKS: Contains methods to notify the client when certain events happen
951  * in the XAudio2 engine. This interface should be implemented by
952  * the client. XAudio2 will call these methods via the interface
953  * pointer provided by the client when it calls XAudio2Create or
954  * IXAudio2::Initialize.
955  *
956  **************************************************************************/
957 
958 #undef INTERFACE
959 #define INTERFACE IXAudio2EngineCallback
960 DECLARE_INTERFACE(IXAudio2EngineCallback)
961 {
962  // Called by XAudio2 just before an audio processing pass begins.
963  STDMETHOD_(void, OnProcessingPassStart) (THIS) PURE;
964 
965  // Called just after an audio processing pass ends.
966  STDMETHOD_(void, OnProcessingPassEnd) (THIS) PURE;
967 
968  // Called in the event of a critical system error which requires XAudio2
969  // to be closed down and restarted. The error code is given in Error.
970  STDMETHOD_(void, OnCriticalError) (THIS_ HRESULT Error) PURE;
971 };
972 
973 
974 /**************************************************************************
975  *
976  * IXAudio2VoiceCallback: Client notification interface for voice events.
977  *
978  * REMARKS: Contains methods to notify the client when certain events happen
979  * in an XAudio2 voice. This interface should be implemented by the
980  * client. XAudio2 will call these methods via an interface pointer
981  * provided by the client in the IXAudio2::CreateSourceVoice call.
982  *
983  **************************************************************************/
984 
985 #undef INTERFACE
986 #define INTERFACE IXAudio2VoiceCallback
987 DECLARE_INTERFACE(IXAudio2VoiceCallback)
988 {
989  // Called just before this voice's processing pass begins.
990  STDMETHOD_(void, OnVoiceProcessingPassStart) (THIS_ UINT32 BytesRequired) PURE;
991 
992  // Called just after this voice's processing pass ends.
993  STDMETHOD_(void, OnVoiceProcessingPassEnd) (THIS) PURE;
994 
995  // Called when this voice has just finished playing a buffer stream
996  // (as marked with the XAUDIO2_END_OF_STREAM flag on the last buffer).
997  STDMETHOD_(void, OnStreamEnd) (THIS) PURE;
998 
999  // Called when this voice is about to start processing a new buffer.
1000  STDMETHOD_(void, OnBufferStart) (THIS_ void* pBufferContext) PURE;
1001 
1002  // Called when this voice has just finished processing a buffer.
1003  // The buffer can now be reused or destroyed.
1004  STDMETHOD_(void, OnBufferEnd) (THIS_ void* pBufferContext) PURE;
1005 
1006  // Called when this voice has just reached the end position of a loop.
1007  STDMETHOD_(void, OnLoopEnd) (THIS_ void* pBufferContext) PURE;
1008 
1009  // Called in the event of a critical error during voice processing,
1010  // such as a failing xAPO or an error from the hardware XMA decoder.
1011  // The voice may have to be destroyed and re-created to recover from
1012  // the error. The callback arguments report which buffer was being
1013  // processed when the error occurred, and its HRESULT code.
1014  STDMETHOD_(void, OnVoiceError) (THIS_ void* pBufferContext, HRESULT Error) PURE;
1015 };
1016 
1017 
1018 /**************************************************************************
1019  *
1020  * Macros to make it easier to use the XAudio2 COM interfaces in C code.
1021  *
1022  **************************************************************************/
1023 
1024 #ifndef __cplusplus
1025 
1026 // IXAudio2
1027 #define IXAudio2_QueryInterface(This,riid,ppvInterface) ((This)->lpVtbl->QueryInterface(This,riid,ppvInterface))
1028 #define IXAudio2_AddRef(This) ((This)->lpVtbl->AddRef(This))
1029 #define IXAudio2_Release(This) ((This)->lpVtbl->Release(This))
1030 #define IXAudio2_GetDeviceCount(This,puCount) ((This)->lpVtbl->GetDeviceCount(This,puCount))
1031 #define IXAudio2_GetDeviceDetails(This,Index,pDeviceDetails) ((This)->lpVtbl->GetDeviceDetails(This,Index,pDeviceDetails))
1032 #define IXAudio2_Initialize(This,Flags,XAudio2Processor) ((This)->lpVtbl->Initialize(This,Flags,XAudio2Processor))
1033 #define IXAudio2_CreateSourceVoice(This,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain) ((This)->lpVtbl->CreateSourceVoice(This,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain))
1034 #define IXAudio2_CreateSubmixVoice(This,ppSubmixVoice,InputChannels,InputSampleRate,Flags,ProcessingStage,pSendList,pEffectChain) ((This)->lpVtbl->CreateSubmixVoice(This,ppSubmixVoice,InputChannels,InputSampleRate,Flags,ProcessingStage,pSendList,pEffectChain))
1035 #define IXAudio2_CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain) ((This)->lpVtbl->CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceIndex,pEffectChain))
1036 #define IXAudio2_StartEngine(This) ((This)->lpVtbl->StartEngine(This))
1037 #define IXAudio2_StopEngine(This) ((This)->lpVtbl->StopEngine(This))
1038 #define IXAudio2_CommitChanges(This,OperationSet) ((This)->lpVtbl->CommitChanges(This,OperationSet))
1039 #define IXAudio2_GetPerformanceData(This,pPerfData) ((This)->lpVtbl->GetPerformanceData(This,pPerfData))
1040 #define IXAudio2_SetDebugConfiguration(This,pDebugConfiguration,pReserved) ((This)->lpVtbl->SetDebugConfiguration(This,pDebugConfiguration,pReserved))
1041 
1042 // IXAudio2Voice
1043 #define IXAudio2Voice_GetVoiceDetails(This,pVoiceDetails) ((This)->lpVtbl->GetVoiceDetails(This,pVoiceDetails))
1044 #define IXAudio2Voice_SetOutputVoices(This,pSendList) ((This)->lpVtbl->SetOutputVoices(This,pSendList))
1045 #define IXAudio2Voice_SetEffectChain(This,pEffectChain) ((This)->lpVtbl->SetEffectChain(This,pEffectChain))
1046 #define IXAudio2Voice_EnableEffect(This,EffectIndex,OperationSet) ((This)->lpVtbl->EnableEffect(This,EffectIndex,OperationSet))
1047 #define IXAudio2Voice_DisableEffect(This,EffectIndex,OperationSet) ((This)->lpVtbl->DisableEffect(This,EffectIndex,OperationSet))
1048 #define IXAudio2Voice_GetEffectState(This,EffectIndex,pEnabled) ((This)->lpVtbl->GetEffectState(This,EffectIndex,pEnabled))
1049 #define IXAudio2Voice_SetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize, OperationSet) ((This)->lpVtbl->SetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize,OperationSet))
1050 #define IXAudio2Voice_GetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize) ((This)->lpVtbl->GetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize))
1051 #define IXAudio2Voice_SetFilterParameters(This,pParameters,OperationSet) ((This)->lpVtbl->SetFilterParameters(This,pParameters,OperationSet))
1052 #define IXAudio2Voice_GetFilterParameters(This,pParameters) ((This)->lpVtbl->GetFilterParameters(This,pParameters))
1053 #define IXAudio2Voice_SetOutputFilterParameters(This,pDestinationVoice,pParameters,OperationSet) ((This)->lpVtbl->SetOutputFilterParameters(This,pDestinationVoice,pParameters,OperationSet))
1054 #define IXAudio2Voice_GetOutputFilterParameters(This,pDestinationVoice,pParameters) ((This)->lpVtbl->GetOutputFilterParameters(This,pDestinationVoice,pParameters))
1055 #define IXAudio2Voice_SetVolume(This,Volume,OperationSet) ((This)->lpVtbl->SetVolume(This,Volume,OperationSet))
1056 #define IXAudio2Voice_GetVolume(This,pVolume) ((This)->lpVtbl->GetVolume(This,pVolume))
1057 #define IXAudio2Voice_SetChannelVolumes(This,Channels,pVolumes,OperationSet) ((This)->lpVtbl->SetChannelVolumes(This,Channels,pVolumes,OperationSet))
1058 #define IXAudio2Voice_GetChannelVolumes(This,Channels,pVolumes) ((This)->lpVtbl->GetChannelVolumes(This,Channels,pVolumes))
1059 #define IXAudio2Voice_SetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix,OperationSet) ((This)->lpVtbl->SetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix,OperationSet))
1060 #define IXAudio2Voice_GetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix) ((This)->lpVtbl->GetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix))
1061 #define IXAudio2Voice_DestroyVoice(This) ((This)->lpVtbl->DestroyVoice(This))
1062 
1063 // IXAudio2SourceVoice
1064 #define IXAudio2SourceVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails
1065 #define IXAudio2SourceVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices
1066 #define IXAudio2SourceVoice_SetEffectChain IXAudio2Voice_SetEffectChain
1067 #define IXAudio2SourceVoice_EnableEffect IXAudio2Voice_EnableEffect
1068 #define IXAudio2SourceVoice_DisableEffect IXAudio2Voice_DisableEffect
1069 #define IXAudio2SourceVoice_GetEffectState IXAudio2Voice_GetEffectState
1070 #define IXAudio2SourceVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters
1071 #define IXAudio2SourceVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters
1072 #define IXAudio2SourceVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters
1073 #define IXAudio2SourceVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters
1074 #define IXAudio2SourceVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters
1075 #define IXAudio2SourceVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters
1076 #define IXAudio2SourceVoice_SetVolume IXAudio2Voice_SetVolume
1077 #define IXAudio2SourceVoice_GetVolume IXAudio2Voice_GetVolume
1078 #define IXAudio2SourceVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes
1079 #define IXAudio2SourceVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes
1080 #define IXAudio2SourceVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix
1081 #define IXAudio2SourceVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix
1082 #define IXAudio2SourceVoice_DestroyVoice IXAudio2Voice_DestroyVoice
1083 #define IXAudio2SourceVoice_Start(This,Flags,OperationSet) ((This)->lpVtbl->Start(This,Flags,OperationSet))
1084 #define IXAudio2SourceVoice_Stop(This,Flags,OperationSet) ((This)->lpVtbl->Stop(This,Flags,OperationSet))
1085 #define IXAudio2SourceVoice_SubmitSourceBuffer(This,pBuffer,pBufferWMA) ((This)->lpVtbl->SubmitSourceBuffer(This,pBuffer,pBufferWMA))
1086 #define IXAudio2SourceVoice_FlushSourceBuffers(This) ((This)->lpVtbl->FlushSourceBuffers(This))
1087 #define IXAudio2SourceVoice_Discontinuity(This) ((This)->lpVtbl->Discontinuity(This))
1088 #define IXAudio2SourceVoice_ExitLoop(This,OperationSet) ((This)->lpVtbl->ExitLoop(This,OperationSet))
1089 #define IXAudio2SourceVoice_GetState(This,pVoiceState) ((This)->lpVtbl->GetState(This,pVoiceState))
1090 #define IXAudio2SourceVoice_SetFrequencyRatio(This,Ratio,OperationSet) ((This)->lpVtbl->SetFrequencyRatio(This,Ratio,OperationSet))
1091 #define IXAudio2SourceVoice_GetFrequencyRatio(This,pRatio) ((This)->lpVtbl->GetFrequencyRatio(This,pRatio))
1092 #define IXAudio2SourceVoice_SetSourceSampleRate(This,NewSourceSampleRate) ((This)->lpVtbl->SetSourceSampleRate(This,NewSourceSampleRate))
1093 
1094 // IXAudio2SubmixVoice
1095 #define IXAudio2SubmixVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails
1096 #define IXAudio2SubmixVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices
1097 #define IXAudio2SubmixVoice_SetEffectChain IXAudio2Voice_SetEffectChain
1098 #define IXAudio2SubmixVoice_EnableEffect IXAudio2Voice_EnableEffect
1099 #define IXAudio2SubmixVoice_DisableEffect IXAudio2Voice_DisableEffect
1100 #define IXAudio2SubmixVoice_GetEffectState IXAudio2Voice_GetEffectState
1101 #define IXAudio2SubmixVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters
1102 #define IXAudio2SubmixVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters
1103 #define IXAudio2SubmixVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters
1104 #define IXAudio2SubmixVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters
1105 #define IXAudio2SubmixVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters
1106 #define IXAudio2SubmixVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters
1107 #define IXAudio2SubmixVoice_SetVolume IXAudio2Voice_SetVolume
1108 #define IXAudio2SubmixVoice_GetVolume IXAudio2Voice_GetVolume
1109 #define IXAudio2SubmixVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes
1110 #define IXAudio2SubmixVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes
1111 #define IXAudio2SubmixVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix
1112 #define IXAudio2SubmixVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix
1113 #define IXAudio2SubmixVoice_DestroyVoice IXAudio2Voice_DestroyVoice
1114 
1115 // IXAudio2MasteringVoice
1116 #define IXAudio2MasteringVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails
1117 #define IXAudio2MasteringVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices
1118 #define IXAudio2MasteringVoice_SetEffectChain IXAudio2Voice_SetEffectChain
1119 #define IXAudio2MasteringVoice_EnableEffect IXAudio2Voice_EnableEffect
1120 #define IXAudio2MasteringVoice_DisableEffect IXAudio2Voice_DisableEffect
1121 #define IXAudio2MasteringVoice_GetEffectState IXAudio2Voice_GetEffectState
1122 #define IXAudio2MasteringVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters
1123 #define IXAudio2MasteringVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters
1124 #define IXAudio2MasteringVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters
1125 #define IXAudio2MasteringVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters
1126 #define IXAudio2MasteringVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters
1127 #define IXAudio2MasteringVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters
1128 #define IXAudio2MasteringVoice_SetVolume IXAudio2Voice_SetVolume
1129 #define IXAudio2MasteringVoice_GetVolume IXAudio2Voice_GetVolume
1130 #define IXAudio2MasteringVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes
1131 #define IXAudio2MasteringVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes
1132 #define IXAudio2MasteringVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix
1133 #define IXAudio2MasteringVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix
1134 #define IXAudio2MasteringVoice_DestroyVoice IXAudio2Voice_DestroyVoice
1135 
1136 #endif // #ifndef __cplusplus
1137 
1138 
1139 /**************************************************************************
1140  *
1141  * Utility functions used to convert from pitch in semitones and volume
1142  * in decibels to the frequency and amplitude ratio units used by XAudio2.
1143  * These are only defined if the client #defines XAUDIO2_HELPER_FUNCTIONS
1144  * prior to #including xaudio2.h.
1145  *
1146  **************************************************************************/
1147 
1148 #ifdef XAUDIO2_HELPER_FUNCTIONS
1149 
1150 #define _USE_MATH_DEFINES // Make math.h define M_PI
1151 #include <math.h> // For powf, log10f, sinf and asinf
1152 
1153 // Calculate the argument to SetVolume from a decibel value
1154 __inline float XAudio2DecibelsToAmplitudeRatio(float Decibels)
1155 {
1156  return powf(10.0f, Decibels / 20.0f);
1157 }
1158 
1159 // Recover a volume in decibels from an amplitude factor
1160 __inline float XAudio2AmplitudeRatioToDecibels(float Volume)
1161 {
1162  if (Volume == 0)
1163  {
1164  return -3.402823466e+38f; // Smallest float value (-FLT_MAX)
1165  }
1166  return 20.0f * log10f(Volume);
1167 }
1168 
1169 // Calculate the argument to SetFrequencyRatio from a semitone value
1170 __inline float XAudio2SemitonesToFrequencyRatio(float Semitones)
1171 {
1172  // FrequencyRatio = 2 ^ Octaves
1173  // = 2 ^ (Semitones / 12)
1174  return powf(2.0f, Semitones / 12.0f);
1175 }
1176 
1177 // Recover a pitch in semitones from a frequency ratio
1178 __inline float XAudio2FrequencyRatioToSemitones(float FrequencyRatio)
1179 {
1180  // Semitones = 12 * log2(FrequencyRatio)
1181  // = 12 * log2(10) * log10(FrequencyRatio)
1182  return 39.86313713864835f * log10f(FrequencyRatio);
1183 }
1184 
1185 // Convert from filter cutoff frequencies expressed in Hertz to the radian
1186 // frequency values used in XAUDIO2_FILTER_PARAMETERS.Frequency. Note that
1187 // the highest CutoffFrequency supported is SampleRate/6. Higher values of
1188 // CutoffFrequency will return XAUDIO2_MAX_FILTER_FREQUENCY.
1189 __inline float XAudio2CutoffFrequencyToRadians(float CutoffFrequency, UINT32 SampleRate)
1190 {
1191  if ((UINT32)(CutoffFrequency * 6.0f) >= SampleRate)
1192  {
1194  }
1195  return 2.0f * sinf((float)M_PI * CutoffFrequency / SampleRate);
1196 }
1197 
1198 // Convert from radian frequencies back to absolute frequencies in Hertz
1199 __inline float XAudio2RadiansToCutoffFrequency(float Radians, float SampleRate)
1200 {
1201  return SampleRate * asinf(Radians / 2.0f) / (float)M_PI;
1202 }
1203 #endif // #ifdef XAUDIO2_HELPER_FUNCTIONS
1204 
1205 
1206 /**************************************************************************
1207  *
1208  * XAudio2Create: Top-level function that creates an XAudio2 instance.
1209  *
1210  * On Windows this is just an inline function that calls CoCreateInstance
1211  * and Initialize. The arguments are described above, under Initialize,
1212  * except that the XAUDIO2_DEBUG_ENGINE flag can be used here to select
1213  * the debug version of XAudio2.
1214  *
1215  * On Xbox, this function is implemented in the XAudio2 library, and the
1216  * XAUDIO2_DEBUG_ENGINE flag has no effect; the client must explicitly
1217  * link with the debug version of the library to obtain debug behavior.
1218  *
1219  **************************************************************************/
1220 
1221 #ifdef _XBOX
1222 
1223 STDAPI XAudio2Create(__deref_out IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0),
1225 
1226 #else // Windows
1227 
1228 __inline HRESULT XAudio2Create(__deref_out IXAudio2** ppXAudio2, UINT32 Flags X2DEFAULT(0),
1230 {
1231  // Instantiate the appropriate XAudio2 engine
1232  IXAudio2* pXAudio2;
1233 
1234  #ifdef __cplusplus
1235 
1236  HRESULT hr = CoCreateInstance((Flags & XAUDIO2_DEBUG_ENGINE) ? __uuidof(XAudio2_Debug) : __uuidof(XAudio2),
1237  NULL, CLSCTX_INPROC_SERVER, __uuidof(IXAudio2), (void**)&pXAudio2);
1238  if (SUCCEEDED(hr))
1239  {
1240  hr = pXAudio2->Initialize(Flags, XAudio2Processor);
1241 
1242  if (SUCCEEDED(hr))
1243  {
1244  *ppXAudio2 = pXAudio2;
1245  }
1246  else
1247  {
1248  pXAudio2->Release();
1249  }
1250  }
1251 
1252  #else
1253 
1254  HRESULT hr = CoCreateInstance((Flags & XAUDIO2_DEBUG_ENGINE) ? &CLSID_XAudio2_Debug : &CLSID_XAudio2,
1255  NULL, CLSCTX_INPROC_SERVER, &IID_IXAudio2, (void**)&pXAudio2);
1256  if (SUCCEEDED(hr))
1257  {
1258  hr = pXAudio2->lpVtbl->Initialize(pXAudio2, Flags, XAudio2Processor);
1259 
1260  if (SUCCEEDED(hr))
1261  {
1262  *ppXAudio2 = pXAudio2;
1263  }
1264  else
1265  {
1266  pXAudio2->lpVtbl->Release(pXAudio2);
1267  }
1268  }
1269 
1270  #endif // #ifdef __cplusplus
1271 
1272  return hr;
1273 }
1274 
1275 #endif // #ifdef _XBOX
1276 
1277 
1278 // Undo the #pragma pack(push, 1) directive at the top of this file
1279 #pragma pack(pop)
1280 
1281 #endif // #ifndef GUID_DEFS_ONLY
1282 #endif // #ifndef __XAUDIO2_INCLUDED__
enum XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER XAUDIO2_PROCESSOR
struct XAUDIO2_VOICE_DETAILS XAUDIO2_VOICE_DETAILS
void * pContext
Definition: XAudio2.h:317
IXAudio2Voice * pOutputVoice
Definition: XAudio2.h:258
XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER
Definition: XAudio2.h:184
#define NULL
Definition: ftobjs.h:61
GLclampf f
Definition: glew.h:3390
typedef HRESULT(WINAPI *LPD3DXIMTSIGNALCALLBACK)(CONST D3DXVECTOR2 *uv
UINT32 ActiveXmaSourceVoices
Definition: XAudio2.h:379
UINT32 LoopBegin
Definition: XAudio2.h:312
#define XAUDIO2_DEBUG_ENGINE
Definition: XAudio2.h:111
UINT32 MinimumCyclesPerQuantum
Definition: XAudio2.h:357
#define Declare_IXAudio2Voice_Methods()
struct XAUDIO2_BUFFER_WMA XAUDIO2_BUFFER_WMA
UINT32 MaximumCyclesPerQuantum
Definition: XAudio2.h:359
UINT32 CurrentLatencyInSamples
Definition: XAudio2.h:366
UINT32 LoopLength
Definition: XAudio2.h:313
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:8736
return Display return Display Bool Bool int d
Definition: SDL_x11sym.h:30
UINT64 SamplesPlayed
Definition: XAudio2.h:345
struct XAUDIO2_EFFECT_DESCRIPTOR XAUDIO2_EFFECT_DESCRIPTOR
UINT32 ActiveSourceVoiceCount
Definition: XAudio2.h:371
DECLARE_INTERFACE_(IXAudio2, IUnknown)
Definition: XAudio2.h:425
struct XAUDIO2_FILTER_PARAMETERS XAUDIO2_FILTER_PARAMETERS
struct XAUDIO2_DEBUG_CONFIGURATION XAUDIO2_DEBUG_CONFIGURATION
UINT32 AudioBytes
Definition: XAudio2.h:307
UINT32 PacketCount
Definition: XAudio2.h:333
UINT32 InputSampleRate
Definition: XAudio2.h:251
struct XAUDIO2_SEND_DESCRIPTOR XAUDIO2_SEND_DESCRIPTOR
#define XAUDIO2_DEFAULT_CHANNELS
Definition: XAudio2.h:107
UINT64 TotalCyclesSinceLastQuery
Definition: XAudio2.h:355
XAUDIO2_SEND_DESCRIPTOR * pSends
Definition: XAudio2.h:265
#define XAUDIO2_MAX_FILTER_FREQUENCY
Definition: XAudio2.h:91
UINT32 BuffersQueued
Definition: XAudio2.h:343
__inline HRESULT XAudio2Create(__deref_out IXAudio2 **ppXAudio2, UINT32 Flags X2DEFAULT(0), XAUDIO2_PROCESSOR XAudio2Processor X2DEFAULT(XAUDIO2_DEFAULT_PROCESSOR))
Definition: XAudio2.h:1228
struct XAUDIO2_EFFECT_CHAIN XAUDIO2_EFFECT_CHAIN
struct XAUDIO2_VOICE_SENDS XAUDIO2_VOICE_SENDS
struct XAUDIO2_DEVICE_DETAILS XAUDIO2_DEVICE_DETAILS
WAVEFORMATEXTENSIBLE OutputFormat
Definition: XAudio2.h:243
UINT32 ActiveSubmixVoiceCount
Definition: XAudio2.h:373
XAUDIO2_DEVICE_ROLE
Definition: XAudio2.h:226
#define XAUDIO2_COMMIT_NOW
Definition: XAudio2.h:102
DEFINE_IID(IXAudio2, 8bcf1f58, 9fe7, 4583, 8a, c6, e2, ad, c4, 65, c8, bb)
WCHAR DeviceID[256]
Definition: XAudio2.h:240
#define X2DEFAULT(x)
Definition: XAudio2.h:420
UINT32 TotalSourceVoiceCount
Definition: XAudio2.h:372
struct XAUDIO2_PERFORMANCE_DATA XAUDIO2_PERFORMANCE_DATA
DECLARE_INTERFACE(IXAudio2Voice)
Definition: XAudio2.h:596
#define XAUDIO2_DEFAULT_SAMPLERATE
Definition: XAudio2.h:108
#define M_PI
Definition: os.h:45
#define XAUDIO2_DEFAULT_FREQ_RATIO
Definition: XAudio2.h:89
struct XAUDIO2_VOICE_STATE XAUDIO2_VOICE_STATE
struct XAUDIO2_BUFFER XAUDIO2_BUFFER
WCHAR DisplayName[256]
Definition: XAudio2.h:241
const UINT32 * pDecodedPacketCumulativeBytes
Definition: XAudio2.h:329
XAUDIO2_DEVICE_ROLE Role
Definition: XAudio2.h:242
UINT64 AudioCyclesSinceLastQuery
Definition: XAudio2.h:353
GLdouble GLdouble GLdouble b
Definition: glew.h:8383
void * pCurrentBufferContext
Definition: XAudio2.h:340
XAUDIO2_FILTER_TYPE
Definition: XAudio2.h:284
const BYTE * pAudioData
Definition: XAudio2.h:308
UINT32 LoopCount
Definition: XAudio2.h:315
UINT32 Flags
Definition: XAudio2.h:306
UINT32 GlitchesSinceEngineStarted
Definition: XAudio2.h:368
UINT32 PlayLength
Definition: XAudio2.h:310
#define FWD_DECLARE(x)
Definition: XAudio2.h:152
UINT32 PlayBegin
Definition: XAudio2.h:309
XAUDIO2_EFFECT_DESCRIPTOR * pEffectDescriptors
Definition: XAudio2.h:280
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: comdecl.h:51
XAUDIO2_FILTER_TYPE Type
Definition: XAudio2.h:295
typedef BOOL(WINAPI *PFNWGLSETSTEREOEMITTERSTATE3DLPROC)(HDC hDC