31 #ifndef __XAUDIO2_INCLUDED__ 32 #define __XAUDIO2_INCLUDED__ 34 #include <sdkddkver.h> 38 #if(_WIN32_WINNT < _WIN32_WINNT_WIN8) 39 #error "This version of XAudio2 is available only in Windows 8 or later. Use the XAudio2 headers and libraries from the DirectX SDK with applications that target Windows 7 and earlier versions." 40 #endif // (_WIN32_WINNT < _WIN32_WINNT_WIN8) 42 #include <winapifamily.h> 44 #pragma region Application Family 45 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_TV_APP | WINAPI_PARTITION_TV_TITLE) 49 #if(_WIN32_WINNT >= _WIN32_WINNT_WIN10) 50 #define XAUDIO2_DLL_A "xaudio2_9.dll" 51 #define XAUDIO2_DLL_W L"xaudio2_9.dll" 52 #define XAUDIO2D_DLL_A "xaudio2_9d.dll" 53 #define XAUDIO2D_DLL_W L"xaudio2_9d.dll" 55 #define XAUDIO2_DLL_A "xaudio2_8.dll" 56 #define XAUDIO2_DLL_W L"xaudio2_8.dll" 57 #define XAUDIO2D_DLL_A "xaudio2_8.dll" 58 #define XAUDIO2D_DLL_W L"xaudio2_8.dll" 62 #define XAUDIO2_DLL XAUDIO2_DLL_W 63 #define XAUDIO2D_DLL XAUDIO2D_DLL_W 65 #define XAUDIO2_DLL XAUDIO2_DLL_A 66 #define XAUDIO2D_DLL XAUDIO2D_DLL_A 78 #if defined(__cplusplus__) && defined(__WINRT__) 80 #if(_WIN32_WINNT >= _WIN32_WINNT_WIN10) 82 interface __declspec(uuid("2B02E3CF-2E0B-4ec3-BE45-1B2A3FE7210D")) IXAudio2;
85 interface __declspec(uuid("60d8dac8-5aa1-4e8e-b597-2f5e2883d484")) IXAudio2;
91 #define DEFINE_GUID_X(n, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 92 static const GUID n = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } 93 #define DEFINE_CLSID_X(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 94 DEFINE_GUID_X(CLSID_##className, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8) 95 #define DEFINE_IID_X(interfaceName, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ 96 DEFINE_GUID_X(IID_##interfaceName, 0x##l, 0x##w1, 0x##w2, 0x##b1, 0x##b2, 0x##b3, 0x##b4, 0x##b5, 0x##b6, 0x##b7, 0x##b8) 98 #if(_WIN32_WINNT >= _WIN32_WINNT_WIN10) 99 DEFINE_IID_X(IXAudio2, 2B02E3CF, 2E0B, 4ec3, BE, 45, 1
B, 2
A, 3
F, E7, 21, 0D);
101 DEFINE_IID_X(IXAudio2, 60d8dac8, 5aa1, 4e8e, b5, 97, 2
f, 5e, 28, 83, d4, 84);
108 #ifndef GUID_DEFS_ONLY 113 #include <audiosessiontypes.h> 116 #pragma pack(push, 1) 126 #define XAUDIO2_MAX_BUFFER_BYTES 0x80000000 // Maximum bytes allowed in a source buffer 127 #define XAUDIO2_MAX_QUEUED_BUFFERS 64 // Maximum buffers allowed in a voice queue 128 #define XAUDIO2_MAX_BUFFERS_SYSTEM 2 // Maximum buffers allowed for system threads (Xbox 360 only) 129 #define XAUDIO2_MAX_AUDIO_CHANNELS 64 // Maximum channels in an audio stream 130 #define XAUDIO2_MIN_SAMPLE_RATE 1000 // Minimum audio sample rate supported 131 #define XAUDIO2_MAX_SAMPLE_RATE 200000 // Maximum audio sample rate supported 132 #define XAUDIO2_MAX_VOLUME_LEVEL 16777216.0f // Maximum acceptable volume level (2^24) 133 #define XAUDIO2_MIN_FREQ_RATIO (1/1024.0f) // Minimum SetFrequencyRatio argument 134 #define XAUDIO2_MAX_FREQ_RATIO 1024.0f // Maximum MaxFrequencyRatio argument 135 #define XAUDIO2_DEFAULT_FREQ_RATIO 2.0f // Default MaxFrequencyRatio argument 136 #define XAUDIO2_MAX_FILTER_ONEOVERQ 1.5f // Maximum XAUDIO2_FILTER_PARAMETERS.OneOverQ 137 #define XAUDIO2_MAX_FILTER_FREQUENCY 1.0f // Maximum XAUDIO2_FILTER_PARAMETERS.Frequency 138 #define XAUDIO2_MAX_LOOP_COUNT 254 // Maximum non-infinite XAUDIO2_BUFFER.LoopCount 139 #define XAUDIO2_MAX_INSTANCES 8 // Maximum simultaneous XAudio2 objects on Xbox 360 144 #define XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MONO 600000 145 #define XAUDIO2_MAX_RATIO_TIMES_RATE_XMA_MULTICHANNEL 300000 148 #define XAUDIO2_COMMIT_NOW 0 // Used as an OperationSet argument 149 #define XAUDIO2_COMMIT_ALL 0 // Used in IXAudio2::CommitChanges 150 #define XAUDIO2_INVALID_OPSET (UINT32)(-1) // Not allowed for OperationSet arguments 151 #define XAUDIO2_NO_LOOP_REGION 0 // Used in XAUDIO2_BUFFER.LoopCount 152 #define XAUDIO2_LOOP_INFINITE 255 // Used in XAUDIO2_BUFFER.LoopCount 153 #define XAUDIO2_DEFAULT_CHANNELS 0 // Used in CreateMasteringVoice 154 #define XAUDIO2_DEFAULT_SAMPLERATE 0 // Used in CreateMasteringVoice 157 #define XAUDIO2_DEBUG_ENGINE 0x0001 // Used in XAudio2Create 158 #define XAUDIO2_VOICE_NOPITCH 0x0002 // Used in IXAudio2::CreateSourceVoice 159 #define XAUDIO2_VOICE_NOSRC 0x0004 // Used in IXAudio2::CreateSourceVoice 160 #define XAUDIO2_VOICE_USEFILTER 0x0008 // Used in IXAudio2::CreateSource/SubmixVoice 161 #define XAUDIO2_PLAY_TAILS 0x0020 // Used in IXAudio2SourceVoice::Stop 162 #define XAUDIO2_END_OF_STREAM 0x0040 // Used in XAUDIO2_BUFFER.Flags 163 #define XAUDIO2_SEND_USEFILTER 0x0080 // Used in XAUDIO2_SEND_DESCRIPTOR.Flags 164 #define XAUDIO2_VOICE_NOSAMPLESPLAYED 0x0100 // Used in IXAudio2SourceVoice::GetState 165 #define XAUDIO2_STOP_ENGINE_WHEN_IDLE 0x2000 // Used in XAudio2Create to force the engine to Stop when no source voices are Started, and Start when a voice is Started 166 #define XAUDIO2_1024_QUANTUM 0x8000 // Used in XAudio2Create to specify nondefault processing quantum of 21.33 ms (1024 samples at 48KHz) 167 #define XAUDIO2_NO_VIRTUAL_AUDIO_CLIENT 0x10000 // Used in CreateMasteringVoice to create a virtual audio client 170 #define XAUDIO2_DEFAULT_FILTER_TYPE LowPassFilter 171 #define XAUDIO2_DEFAULT_FILTER_FREQUENCY XAUDIO2_MAX_FILTER_FREQUENCY 172 #define XAUDIO2_DEFAULT_FILTER_ONEOVERQ 1.0f 177 #define XAUDIO2_QUANTUM_NUMERATOR 1 // On Windows, XAudio2 processes audio 178 #define XAUDIO2_QUANTUM_DENOMINATOR 100 // in 10ms chunks (= 1/100 seconds) 179 #define XAUDIO2_QUANTUM_MS (1000.0f * XAUDIO2_QUANTUM_NUMERATOR / XAUDIO2_QUANTUM_DENOMINATOR) 182 #define FACILITY_XAUDIO2 0x896 183 #define XAUDIO2_E_INVALID_CALL 0x88960001 // An API call or one of its arguments was illegal 184 #define XAUDIO2_E_XMA_DECODER_ERROR 0x88960002 // The XMA hardware suffered an unrecoverable error 185 #define XAUDIO2_E_XAPO_CREATION_FAILED 0x88960003 // XAudio2 failed to initialize an XAPO effect 186 #define XAUDIO2_E_DEVICE_INVALIDATED 0x88960004 // An audio device became unusable (unplugged, etc) 195 #define FWD_DECLARE(x) interface x 197 #define FWD_DECLARE(x) typedef interface x x 200 FWD_DECLARE(IXAudio2);
201 FWD_DECLARE(IXAudio2Voice);
202 FWD_DECLARE(IXAudio2SourceVoice);
204 FWD_DECLARE(IXAudio2MasteringVoice);
206 FWD_DECLARE(IXAudio2VoiceCallback);
217 #define Processor1 0x00000001 218 #define Processor2 0x00000002 219 #define Processor3 0x00000004 220 #define Processor4 0x00000008 221 #define Processor5 0x00000010 222 #define Processor6 0x00000020 223 #define Processor7 0x00000040 224 #define Processor8 0x00000080 225 #define Processor9 0x00000100 226 #define Processor10 0x00000200 227 #define Processor11 0x00000400 228 #define Processor12 0x00000800 229 #define Processor13 0x00001000 230 #define Processor14 0x00002000 231 #define Processor15 0x00004000 232 #define Processor16 0x00008000 233 #define Processor17 0x00010000 234 #define Processor18 0x00020000 235 #define Processor19 0x00040000 236 #define Processor20 0x00080000 237 #define Processor21 0x00100000 238 #define Processor22 0x00200000 239 #define Processor23 0x00400000 240 #define Processor24 0x00800000 241 #define Processor25 0x01000000 242 #define Processor26 0x02000000 243 #define Processor27 0x04000000 244 #define Processor28 0x08000000 245 #define Processor29 0x10000000 246 #define Processor30 0x20000000 247 #define Processor31 0x40000000 248 #define Processor32 0x80000000 249 #define XAUDIO2_ANY_PROCESSOR 0xffffffff 250 #define XAUDIO2_DEFAULT_PROCESSOR Processor1 262 typedef struct XAUDIO2_SEND_DESCRIPTOR
265 IXAudio2Voice* pOutputVoice;
266 } XAUDIO2_SEND_DESCRIPTOR;
272 XAUDIO2_SEND_DESCRIPTOR* pSends;
297 LowPassOnePoleFilter,
298 HighPassOnePoleFilter
340 const UINT32* pDecodedPacketCumulativeBytes;
351 void* pCurrentBufferContext;
367 UINT64 AudioCyclesSinceLastQuery;
369 UINT64 TotalCyclesSinceLastQuery;
371 UINT32 MinimumCyclesPerQuantum;
373 UINT32 MaximumCyclesPerQuantum;
377 UINT32 MemoryUsageInBytes;
380 UINT32 CurrentLatencyInSamples;
382 UINT32 GlitchesSinceEngineStarted;
385 UINT32 ActiveSourceVoiceCount;
386 UINT32 TotalSourceVoiceCount;
387 UINT32 ActiveSubmixVoiceCount;
389 UINT32 ActiveResamplerCount;
390 UINT32 ActiveMatrixMixCount;
393 UINT32 ActiveXmaSourceVoices;
404 BOOL LogFunctionName;
412 #define XAUDIO2_LOG_ERRORS 0x0001 // For handled errors with serious effects. 413 #define XAUDIO2_LOG_WARNINGS 0x0002 // For handled errors that may be recoverable. 414 #define XAUDIO2_LOG_INFO 0x0004 // Informational chit-chat (e.g. state changes). 415 #define XAUDIO2_LOG_DETAIL 0x0008 // More detailed chit-chat. 416 #define XAUDIO2_LOG_API_CALLS 0x0010 // Public API function entries and exits. 417 #define XAUDIO2_LOG_FUNC_CALLS 0x0020 // Internal function entries and exits. 418 #define XAUDIO2_LOG_TIMING 0x0040 // Delays detected and other timing data. 419 #define XAUDIO2_LOG_LOCKS 0x0080 // Usage of critical sections and mutexes. 420 #define XAUDIO2_LOG_MEMORY 0x0100 // Memory heap usage information. 421 #define XAUDIO2_LOG_STREAMING 0x1000 // Audio streaming information. 432 #define X2DEFAULT(x) =x 438 #define INTERFACE IXAudio2 449 STDMETHOD(QueryInterface) (THIS_ REFIID riid, _Outptr_
void** ppvInterface) PURE;
454 STDMETHOD_(ULONG, AddRef) (THIS) PURE;
459 STDMETHOD_(ULONG,
Release) (THIS) PURE;
489 STDMETHOD(CreateSourceVoice) (THIS_ _Outptr_ IXAudio2SourceVoice** ppSourceVoice,
528 STDMETHOD(CreateMasteringVoice) (THIS_ _Outptr_ IXAudio2MasteringVoice** ppMasteringVoice,
533 _In_ AUDIO_STREAM_CATEGORY StreamCategory
X2DEFAULT(AudioCategory_GameEffects)) PURE;
538 STDMETHOD(StartEngine) (THIS) PURE;
543 STDMETHOD_(
void, StopEngine) (THIS) PURE;
552 STDMETHOD(CommitChanges) (THIS_
UINT32 OperationSet) PURE;
581 #define INTERFACE IXAudio2Voice 587 #define Declare_IXAudio2Voice_Methods() \ 595 STDMETHOD_(void, GetVoiceDetails) (THIS_ _Out_ XAUDIO2_VOICE_DETAILS* pVoiceDetails) PURE; \ 604 STDMETHOD(SetOutputVoices) (THIS_ _In_opt_ const XAUDIO2_VOICE_SENDS* pSendList) PURE; \ 612 STDMETHOD(SetEffectChain) (THIS_ _In_opt_ const XAUDIO2_EFFECT_CHAIN* pEffectChain) PURE; \ 621 STDMETHOD(EnableEffect) (THIS_ UINT32 EffectIndex, \ 622 UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ 631 STDMETHOD(DisableEffect) (THIS_ UINT32 EffectIndex, \ 632 UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ 641 STDMETHOD_(void, GetEffectState) (THIS_ UINT32 EffectIndex, _Out_ BOOL* pEnabled) PURE; \ 657 STDMETHOD(SetEffectParameters) (THIS_ UINT32 EffectIndex, \ 658 _In_reads_bytes_(ParametersByteSize) const void* pParameters, \ 659 UINT32 ParametersByteSize, \ 660 UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ 670 STDMETHOD(GetEffectParameters) (THIS_ UINT32 EffectIndex, \ 671 _Out_writes_bytes_(ParametersByteSize) void* pParameters, \ 672 UINT32 ParametersByteSize) PURE; \ 681 STDMETHOD(SetFilterParameters) (THIS_ _In_ const XAUDIO2_FILTER_PARAMETERS* pParameters, \ 682 UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ 690 STDMETHOD_(void, GetFilterParameters) (THIS_ _Out_ XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \ 700 STDMETHOD(SetOutputFilterParameters) (THIS_ _In_opt_ IXAudio2Voice* pDestinationVoice, \ 701 _In_ const XAUDIO2_FILTER_PARAMETERS* pParameters, \ 702 UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ 711 STDMETHOD_(void, GetOutputFilterParameters) (THIS_ _In_opt_ IXAudio2Voice* pDestinationVoice, \ 712 _Out_ XAUDIO2_FILTER_PARAMETERS* pParameters) PURE; \ 721 STDMETHOD(SetVolume) (THIS_ float Volume, \ 722 UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ 730 STDMETHOD_(void, GetVolume) (THIS_ _Out_ float* pVolume) PURE; \ 740 STDMETHOD(SetChannelVolumes) (THIS_ UINT32 Channels, _In_reads_(Channels) const float* pVolumes, \ 741 UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ 750 STDMETHOD_(void, GetChannelVolumes) (THIS_ UINT32 Channels, _Out_writes_(Channels) float* pVolumes) PURE; \ 767 STDMETHOD(SetOutputMatrix) (THIS_ _In_opt_ IXAudio2Voice* pDestinationVoice, \ 768 UINT32 SourceChannels, UINT32 DestinationChannels, \ 769 _In_reads_(SourceChannels * DestinationChannels) const float* pLevelMatrix, \ 770 UINT32 OperationSet X2DEFAULT(XAUDIO2_COMMIT_NOW)) PURE; \ 784 STDMETHOD_(void, GetOutputMatrix) (THIS_ _In_opt_ IXAudio2Voice* pDestinationVoice, \ 785 UINT32 SourceChannels, UINT32 DestinationChannels, \ 786 _Out_writes_(SourceChannels * DestinationChannels) float* pLevelMatrix) PURE; \ 792 STDMETHOD_(void, DestroyVoice) (THIS) PURE 805 #define INTERFACE IXAudio2SourceVoice 841 STDMETHOD(FlushSourceBuffers) (THIS) PURE;
848 STDMETHOD(Discontinuity) (THIS) PURE;
876 STDMETHOD(SetFrequencyRatio) (THIS_
float Ratio,
885 STDMETHOD_(
void, GetFrequencyRatio) (THIS_ _Out_
float* pRatio) PURE;
895 STDMETHOD(SetSourceSampleRate) (THIS_
UINT32 NewSourceSampleRate) PURE;
906 #define INTERFACE IXAudio2SubmixVoice 923 #define INTERFACE IXAudio2MasteringVoice 936 STDMETHOD(GetChannelMask) (THIS_ _Out_ DWORD* pChannelmask) PURE;
953 #define INTERFACE IXAudio2EngineCallback 957 STDMETHOD_(
void, OnProcessingPassStart) (THIS) PURE;
960 STDMETHOD_(
void, OnProcessingPassEnd) (THIS) PURE;
964 STDMETHOD_(
void, OnCriticalError) (THIS_
HRESULT Error) PURE;
980 #define INTERFACE IXAudio2VoiceCallback 984 STDMETHOD_(
void, OnVoiceProcessingPassStart) (THIS_
UINT32 BytesRequired) PURE;
987 STDMETHOD_(
void, OnVoiceProcessingPassEnd) (THIS) PURE;
991 STDMETHOD_(
void, OnStreamEnd) (THIS) PURE;
994 STDMETHOD_(
void, OnBufferStart) (THIS_
void* pBufferContext) PURE;
998 STDMETHOD_(
void, OnBufferEnd) (THIS_
void* pBufferContext) PURE;
1001 STDMETHOD_(
void, OnLoopEnd) (THIS_
void* pBufferContext) PURE;
1008 STDMETHOD_(
void, OnVoiceError) (THIS_
void* pBufferContext,
HRESULT Error) PURE;
1021 #define IXAudio2_QueryInterface(This,riid,ppvInterface) ((This)->lpVtbl->QueryInterface(This,riid,ppvInterface)) 1022 #define IXAudio2_AddRef(This) ((This)->lpVtbl->AddRef(This)) 1023 #define IXAudio2_Release(This) ((This)->lpVtbl->Release(This)) 1024 #define IXAudio2_CreateSourceVoice(This,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain) ((This)->lpVtbl->CreateSourceVoice(This,ppSourceVoice,pSourceFormat,Flags,MaxFrequencyRatio,pCallback,pSendList,pEffectChain)) 1025 #define IXAudio2_CreateSubmixVoice(This,ppSubmixVoice,InputChannels,InputSampleRate,Flags,ProcessingStage,pSendList,pEffectChain) ((This)->lpVtbl->CreateSubmixVoice(This,ppSubmixVoice,InputChannels,InputSampleRate,Flags,ProcessingStage,pSendList,pEffectChain)) 1026 #define IXAudio2_CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceId,pEffectChain,StreamCategory) ((This)->lpVtbl->CreateMasteringVoice(This,ppMasteringVoice,InputChannels,InputSampleRate,Flags,DeviceId,pEffectChain,StreamCategory)) 1027 #define IXAudio2_StartEngine(This) ((This)->lpVtbl->StartEngine(This)) 1028 #define IXAudio2_StopEngine(This) ((This)->lpVtbl->StopEngine(This)) 1029 #define IXAudio2_CommitChanges(This,OperationSet) ((This)->lpVtbl->CommitChanges(This,OperationSet)) 1030 #define IXAudio2_GetPerformanceData(This,pPerfData) ((This)->lpVtbl->GetPerformanceData(This,pPerfData)) 1031 #define IXAudio2_SetDebugConfiguration(This,pDebugConfiguration,pReserved) ((This)->lpVtbl->SetDebugConfiguration(This,pDebugConfiguration,pReserved)) 1034 #define IXAudio2Voice_GetVoiceDetails(This,pVoiceDetails) ((This)->lpVtbl->GetVoiceDetails(This,pVoiceDetails)) 1035 #define IXAudio2Voice_SetOutputVoices(This,pSendList) ((This)->lpVtbl->SetOutputVoices(This,pSendList)) 1036 #define IXAudio2Voice_SetEffectChain(This,pEffectChain) ((This)->lpVtbl->SetEffectChain(This,pEffectChain)) 1037 #define IXAudio2Voice_EnableEffect(This,EffectIndex,OperationSet) ((This)->lpVtbl->EnableEffect(This,EffectIndex,OperationSet)) 1038 #define IXAudio2Voice_DisableEffect(This,EffectIndex,OperationSet) ((This)->lpVtbl->DisableEffect(This,EffectIndex,OperationSet)) 1039 #define IXAudio2Voice_GetEffectState(This,EffectIndex,pEnabled) ((This)->lpVtbl->GetEffectState(This,EffectIndex,pEnabled)) 1040 #define IXAudio2Voice_SetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize, OperationSet) ((This)->lpVtbl->SetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize,OperationSet)) 1041 #define IXAudio2Voice_GetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize) ((This)->lpVtbl->GetEffectParameters(This,EffectIndex,pParameters,ParametersByteSize)) 1042 #define IXAudio2Voice_SetFilterParameters(This,pParameters,OperationSet) ((This)->lpVtbl->SetFilterParameters(This,pParameters,OperationSet)) 1043 #define IXAudio2Voice_GetFilterParameters(This,pParameters) ((This)->lpVtbl->GetFilterParameters(This,pParameters)) 1044 #define IXAudio2Voice_SetOutputFilterParameters(This,pDestinationVoice,pParameters,OperationSet) ((This)->lpVtbl->SetOutputFilterParameters(This,pDestinationVoice,pParameters,OperationSet)) 1045 #define IXAudio2Voice_GetOutputFilterParameters(This,pDestinationVoice,pParameters) ((This)->lpVtbl->GetOutputFilterParameters(This,pDestinationVoice,pParameters)) 1046 #define IXAudio2Voice_SetVolume(This,Volume,OperationSet) ((This)->lpVtbl->SetVolume(This,Volume,OperationSet)) 1047 #define IXAudio2Voice_GetVolume(This,pVolume) ((This)->lpVtbl->GetVolume(This,pVolume)) 1048 #define IXAudio2Voice_SetChannelVolumes(This,Channels,pVolumes,OperationSet) ((This)->lpVtbl->SetChannelVolumes(This,Channels,pVolumes,OperationSet)) 1049 #define IXAudio2Voice_GetChannelVolumes(This,Channels,pVolumes) ((This)->lpVtbl->GetChannelVolumes(This,Channels,pVolumes)) 1050 #define IXAudio2Voice_SetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix,OperationSet) ((This)->lpVtbl->SetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix,OperationSet)) 1051 #define IXAudio2Voice_GetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix) ((This)->lpVtbl->GetOutputMatrix(This,pDestinationVoice,SourceChannels,DestinationChannels,pLevelMatrix)) 1052 #define IXAudio2Voice_DestroyVoice(This) ((This)->lpVtbl->DestroyVoice(This)) 1055 #define IXAudio2SourceVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails 1056 #define IXAudio2SourceVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices 1057 #define IXAudio2SourceVoice_SetEffectChain IXAudio2Voice_SetEffectChain 1058 #define IXAudio2SourceVoice_EnableEffect IXAudio2Voice_EnableEffect 1059 #define IXAudio2SourceVoice_DisableEffect IXAudio2Voice_DisableEffect 1060 #define IXAudio2SourceVoice_GetEffectState IXAudio2Voice_GetEffectState 1061 #define IXAudio2SourceVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters 1062 #define IXAudio2SourceVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters 1063 #define IXAudio2SourceVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters 1064 #define IXAudio2SourceVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters 1065 #define IXAudio2SourceVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters 1066 #define IXAudio2SourceVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters 1067 #define IXAudio2SourceVoice_SetVolume IXAudio2Voice_SetVolume 1068 #define IXAudio2SourceVoice_GetVolume IXAudio2Voice_GetVolume 1069 #define IXAudio2SourceVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes 1070 #define IXAudio2SourceVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes 1071 #define IXAudio2SourceVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix 1072 #define IXAudio2SourceVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix 1073 #define IXAudio2SourceVoice_DestroyVoice IXAudio2Voice_DestroyVoice 1074 #define IXAudio2SourceVoice_Start(This,Flags,OperationSet) ((This)->lpVtbl->Start(This,Flags,OperationSet)) 1075 #define IXAudio2SourceVoice_Stop(This,Flags,OperationSet) ((This)->lpVtbl->Stop(This,Flags,OperationSet)) 1076 #define IXAudio2SourceVoice_SubmitSourceBuffer(This,pBuffer,pBufferWMA) ((This)->lpVtbl->SubmitSourceBuffer(This,pBuffer,pBufferWMA)) 1077 #define IXAudio2SourceVoice_FlushSourceBuffers(This) ((This)->lpVtbl->FlushSourceBuffers(This)) 1078 #define IXAudio2SourceVoice_Discontinuity(This) ((This)->lpVtbl->Discontinuity(This)) 1079 #define IXAudio2SourceVoice_ExitLoop(This,OperationSet) ((This)->lpVtbl->ExitLoop(This,OperationSet)) 1080 #define IXAudio2SourceVoice_GetState(This,pVoiceState,Flags) ((This)->lpVtbl->GetState(This,pVoiceState,Flags)) 1081 #define IXAudio2SourceVoice_SetFrequencyRatio(This,Ratio,OperationSet) ((This)->lpVtbl->SetFrequencyRatio(This,Ratio,OperationSet)) 1082 #define IXAudio2SourceVoice_GetFrequencyRatio(This,pRatio) ((This)->lpVtbl->GetFrequencyRatio(This,pRatio)) 1083 #define IXAudio2SourceVoice_SetSourceSampleRate(This,NewSourceSampleRate) ((This)->lpVtbl->SetSourceSampleRate(This,NewSourceSampleRate)) 1086 #define IXAudio2SubmixVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails 1087 #define IXAudio2SubmixVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices 1088 #define IXAudio2SubmixVoice_SetEffectChain IXAudio2Voice_SetEffectChain 1089 #define IXAudio2SubmixVoice_EnableEffect IXAudio2Voice_EnableEffect 1090 #define IXAudio2SubmixVoice_DisableEffect IXAudio2Voice_DisableEffect 1091 #define IXAudio2SubmixVoice_GetEffectState IXAudio2Voice_GetEffectState 1092 #define IXAudio2SubmixVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters 1093 #define IXAudio2SubmixVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters 1094 #define IXAudio2SubmixVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters 1095 #define IXAudio2SubmixVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters 1096 #define IXAudio2SubmixVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters 1097 #define IXAudio2SubmixVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters 1098 #define IXAudio2SubmixVoice_SetVolume IXAudio2Voice_SetVolume 1099 #define IXAudio2SubmixVoice_GetVolume IXAudio2Voice_GetVolume 1100 #define IXAudio2SubmixVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes 1101 #define IXAudio2SubmixVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes 1102 #define IXAudio2SubmixVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix 1103 #define IXAudio2SubmixVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix 1104 #define IXAudio2SubmixVoice_DestroyVoice IXAudio2Voice_DestroyVoice 1107 #define IXAudio2MasteringVoice_GetVoiceDetails IXAudio2Voice_GetVoiceDetails 1108 #define IXAudio2MasteringVoice_SetOutputVoices IXAudio2Voice_SetOutputVoices 1109 #define IXAudio2MasteringVoice_SetEffectChain IXAudio2Voice_SetEffectChain 1110 #define IXAudio2MasteringVoice_EnableEffect IXAudio2Voice_EnableEffect 1111 #define IXAudio2MasteringVoice_DisableEffect IXAudio2Voice_DisableEffect 1112 #define IXAudio2MasteringVoice_GetEffectState IXAudio2Voice_GetEffectState 1113 #define IXAudio2MasteringVoice_SetEffectParameters IXAudio2Voice_SetEffectParameters 1114 #define IXAudio2MasteringVoice_GetEffectParameters IXAudio2Voice_GetEffectParameters 1115 #define IXAudio2MasteringVoice_SetFilterParameters IXAudio2Voice_SetFilterParameters 1116 #define IXAudio2MasteringVoice_GetFilterParameters IXAudio2Voice_GetFilterParameters 1117 #define IXAudio2MasteringVoice_SetOutputFilterParameters IXAudio2Voice_SetOutputFilterParameters 1118 #define IXAudio2MasteringVoice_GetOutputFilterParameters IXAudio2Voice_GetOutputFilterParameters 1119 #define IXAudio2MasteringVoice_SetVolume IXAudio2Voice_SetVolume 1120 #define IXAudio2MasteringVoice_GetVolume IXAudio2Voice_GetVolume 1121 #define IXAudio2MasteringVoice_SetChannelVolumes IXAudio2Voice_SetChannelVolumes 1122 #define IXAudio2MasteringVoice_GetChannelVolumes IXAudio2Voice_GetChannelVolumes 1123 #define IXAudio2MasteringVoice_SetOutputMatrix IXAudio2Voice_SetOutputMatrix 1124 #define IXAudio2MasteringVoice_GetOutputMatrix IXAudio2Voice_GetOutputMatrix 1125 #define IXAudio2MasteringVoice_DestroyVoice IXAudio2Voice_DestroyVoice 1126 #define IXAudio2MasteringVoice_GetChannelMask(This,pChannelMask) ((This)->lpVtbl->GetChannelMask(This,pChannelMask)) 1140 #ifdef XAUDIO2_HELPER_FUNCTIONS 1142 #define _USE_MATH_DEFINES 1146 static INLINE float XAudio2DecibelsToAmplitudeRatio(
float Decibels)
1148 return powf(10.0
f, Decibels / 20.0
f);
1152 static INLINE float XAudio2AmplitudeRatioToDecibels(
float Volume)
1155 return -3.402823466e+38
f;
1156 return 20.0f * log10f(Volume);
1160 static INLINE float XAudio2SemitonesToFrequencyRatio(
float Semitones)
1165 return powf(2.0
f, Semitones / 12.0
f);
1169 static INLINE float XAudio2FrequencyRatioToSemitones(
float FrequencyRatio)
1174 return 39.86313713864835f * log10f(FrequencyRatio);
1183 static INLINE float XAudio2CutoffFrequencyToRadians(
float CutoffFrequency,
UINT32 SampleRate)
1185 if ((
UINT32)(CutoffFrequency * 6.0
f) >= SampleRate)
1186 return XAUDIO2_MAX_FILTER_FREQUENCY;
1187 return 2.0f * sinf((
float)
M_PI * CutoffFrequency / SampleRate);
1191 static INLINE float XAudio2RadiansToCutoffFrequency(
float Radians,
float SampleRate)
1193 return SampleRate * asinf(Radians / 2.0
f) / (float)
M_PI;
1201 static INLINE float XAudio2CutoffFrequencyToOnePoleCoefficient(
float CutoffFrequency,
UINT32 SampleRate)
1203 if ((
UINT32)CutoffFrequency >= SampleRate)
1204 return XAUDIO2_MAX_FILTER_FREQUENCY;
1205 return (1.0
f - powf(1.0
f - 2.0
f * CutoffFrequency / SampleRate, 2.0
f));
1209 #endif // #ifdef XAUDIO2_HELPER_FUNCTIONS 1230 #ifdef __cplusplus__ 1232 #if (defined XAUDIO2_EXPORT) 1234 #define XAUDIO2_STDAPI extern "C" __declspec(dllexport) HRESULT __stdcall 1237 #define XAUDIO2_STDAPI extern "C" __declspec(dllimport) HRESULT __stdcall 1244 #if (defined XAUDIO2_EXPORT) 1246 #define XAUDIO2_STDAPI __declspec(dllexport) HRESULT __stdcall 1249 #define XAUDIO2_STDAPI __declspec(dllimport) HRESULT __stdcall 1254 #if (NTDDI_VERSION >= NTDDI_WIN10_RS5) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 1255 XAUDIO2_STDAPI XAudio2CreateWithVersionInfo(_Outptr_ IXAudio2** ppXAudio2,
1258 DWORD ntddiVersion
X2DEFAULT(NTDDI_VERSION));
1269 static HMODULE s_dllInstance =
NULL;
1270 static XAudio2CreateWithVersionInfoFunc s_pfnAudio2CreateWithVersion =
NULL;
1271 static XAudio2CreateInfoFunc s_pfnAudio2Create =
NULL;
1273 if (s_dllInstance ==
NULL)
1275 s_dllInstance = LoadLibraryEx(XAUDIO2_DLL,
NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
1276 if (s_dllInstance ==
NULL)
1277 return HRESULT_FROM_WIN32(GetLastError());
1279 s_pfnAudio2CreateWithVersion = (XAudio2CreateWithVersionInfoFunc)(
void*)GetProcAddress(s_dllInstance,
"XAudio2CreateWithVersionInfo");
1280 if (s_pfnAudio2CreateWithVersion ==
NULL)
1282 s_pfnAudio2Create = (XAudio2CreateInfoFunc)(
void*)GetProcAddress(s_dllInstance,
"XAudio2Create");
1283 if (s_pfnAudio2Create ==
NULL)
1284 return HRESULT_FROM_WIN32(GetLastError());
1288 if (s_pfnAudio2CreateWithVersion !=
NULL)
1289 return (*s_pfnAudio2CreateWithVersion)(ppXAudio2, Flags, XAudio2Processor, NTDDI_VERSION);
1290 return (*s_pfnAudio2Create)(ppXAudio2, Flags, XAudio2Processor);
UINT32 PlayBegin
Definition: xaudio27.h:178
XAUDIO2_FILTER_TYPE
Definition: xaudio27.h:131
#define Declare_IXAudio2Voice_Methods()
byte Error
Definition: jsonsax_full.c:107
enum XAUDIO2_WINDOWS_PROCESSOR_SPECIFIER XAUDIO2_PROCESSOR
#define INLINE
Definition: retro_inline.h:35
UINT32 AudioBytes
Definition: xaudio27.h:176
struct XAUDIO2_BUFFER XAUDIO2_BUFFER
Definition: xaudio27.h:127
Ιστορικό Εικόνα Πληροφορίες Όλοι Οι Χρήστες Χειρίζονται Το Μενού Αριστερό Αναλογικό Αριστερό Αναλογικό Αριστερό Αναλογικό Y Αριστερό Αναλογικό Δεξί Αναλογικό X Δεξί Αναλογικό Δεξί Αναλογικό Y Δεξί Αναλογικό Σκανδάλη Όπλου Όπλο Aux A Όπλο Aux C Όπλο Select Όπλο D pad Κάτω Όπλο D pad Δεξιά Νεκρή Ζώνη Αναλογικού Σύνδεση Όλων Λήξη Χρόνου Σύνδεσης Hide Unbound Core Input Descriptors Κατάλογος Συσκευών Κατάλογος Ποντικιού Duty Cycle Keyboard Gamepad Mapping Enable Κουμπί B(κάτω)" ) MSG_HASH( MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN
interface __declspec(uuid("A410B984-9839-4819-A0BE-2856AE6B3ADB")) IXAPO
OPAQUE XAUDIO2_VOICE_STATE XAUDIO2_VOICE_STATE
Definition: xaudio27.h:165
uint64_t UINT64
Definition: coretypes.h:8
OPAQUE XAUDIO2_EFFECT_DESCRIPTOR XAUDIO2_EFFECT_DESCRIPTOR
Definition: xaudio27.h:161
GLfloat f
Definition: glext.h:8207
OPAQUE XAUDIO2_FILTER_PARAMETERS XAUDIO2_FILTER_PARAMETERS
Definition: xaudio27.h:163
void * pContext
Definition: xaudio27.h:183
OPAQUE XAUDIO2_VOICE_DETAILS XAUDIO2_VOICE_DETAILS
Definition: xaudio27.h:159
typedef HRESULT(WINAPI *PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(_In_ const D3D12_ROOT_SIGNATURE_DESC *pRootSignature
#define M_PI
Definition: compat.h:190
_Outptr_ IUnknown ** pEffect
Definition: xapofx.h:175
OPAQUE IXAudio2EngineCallback IXAudio2EngineCallback
Definition: xaudio27.h:168
DECLARE_INTERFACE(IXAudio2VoiceCallback)
Definition: xaudio27.h:189
#define NULL
Pointer to 0.
Definition: gctypes.h:65
OPAQUE XAUDIO2_BUFFER_WMA XAUDIO2_BUFFER_WMA
Definition: xaudio27.h:164
static INLINE HRESULT XAudio2Create(IXAudio2 **ppXAudio2, UINT32 flags, XAUDIO2_PROCESSOR proc)
Definition: xaudio27.h:339
#define X2DEFAULT(x)
Definition: xaudio27.h:32
OPAQUE IXAudio2SubmixVoice IXAudio2SubmixVoice
Definition: xaudio27.h:169
Definition: xaudio27.h:133
OPAQUE XAUDIO2_DEBUG_CONFIGURATION XAUDIO2_DEBUG_CONFIGURATION
Definition: xaudio27.h:167
#define A(i)
Definition: ecp_curves.c:884
OPAQUE XAUDIO2_PERFORMANCE_DATA XAUDIO2_PERFORMANCE_DATA
Definition: xaudio27.h:166
UINT32 LoopCount
Definition: xaudio27.h:182
UINT32 LoopLength
Definition: xaudio27.h:181
UINT32 LoopBegin
Definition: xaudio27.h:180
static INLINE ULONG Release(void *object)
Definition: dxgi_common.h:253
UINT32 Flags
Definition: xaudio27.h:175
unsigned int BOOL
Definition: gctypes.h:51
uint32_t UINT32
Definition: coretypes.h:10
const BYTE * pAudioData
Definition: xaudio27.h:177
OPAQUE XAUDIO2_VOICE_SENDS XAUDIO2_VOICE_SENDS
Definition: xaudio27.h:160
#define XAUDIO2_DEFAULT_CHANNELS
Definition: xaudio27.h:90
DECLARE_INTERFACE_(IXAudio2MasteringVoice, IXAudio2Voice)
Definition: xaudio27.h:247
Definition: audiodefs.h:40
OPAQUE XAUDIO2_EFFECT_CHAIN XAUDIO2_EFFECT_CHAIN
Definition: xaudio27.h:162
#define XAUDIO2_COMMIT_NOW
Definition: xaudio27.h:89
Type
Type of JSON value.
Definition: rapidjson.h:603
DEFINE_IID_X(IXAudio2, 8bcf1f58, 9fe7, 4583, 8a, c6, e2, ad, c4, 65, c8, bb)
UINT32 PlayLength
Definition: xaudio27.h:179
Definition: xaudio27.h:173
#define XAUDIO2_DEFAULT_SAMPLERATE
Definition: xaudio27.h:91
Definition: xaudio27.h:132
#define XAUDIO2_DEFAULT_FREQ_RATIO
Definition: xaudio27.h:86
Definition: xaudio27.h:134