@Hao Wu , The DirectX 9.0c SDK is very old. It is over 10+ years old so definitely the latest Direct X SDK is recommend to use. Please feel free to let us know if you still have issues if you are using the latest XAudio2 API.
XAudio2Create failed after the update 2021/4/20
Windows10 version 20H2.
I followed every step-Getting started with XAudio2-How to: Initialize XAudio2.
The link is here. https://learn.microsoft.com/en-us/windows/win32/xaudio2/getting-started
The code worked before the update. But now when I try to do something like this:
pXAudio2->CreateSourceVoice( &pSourceVoice, (WAVEFORMATEX*)&wfx )
It is said the value of pSourceVoice is nullptr.
I'm sure I have done all these code down here.
Microsoft::WRL::ComPtr<IXAudio2> XAudio2;
HRESULT hr;
if ( FAILED(hr = XAudio2Create( &XAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR ) ) )
throw Platform::Exception::CreateException(hr);
IXAudio2MasteringVoice* pMasterVoice = nullptr;
if ( FAILED(hr = pXAudio2->CreateMasteringVoice( &pMasterVoice ) ) )
return hr;
Is there anything I can do now?