The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
[UWP][C++] Win10 WACK failure due to XAudio2 usage RRS feed

  • Question

  • Hi,

    I'm running our Win10 UWP game through Window App Certification Kit 10.0 and am getting a failure due to XAudio2Create usage.
    "API XAudio2Create in xaudio2_9.dll is not supported for this application type. BlankTest.exe calls this API"

    From what I can tell in the documentation, XAudio2 should be supported.  https://msdn.microsoft.com/en-us/library/windows/apps/dn424765.aspx

    This WACK failure is reproducible in a blank C++ Windows Universal app, and adding the following code:

    IXAudio2* pXAudio2 = nullptr;	
    HRESULT hr = XAudio2Create(&pXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR);

    How can I fix the failure?  Or is it a problem with the WACK test, at this point?  We're on Windows 10 preview build 10130.

    Thanks.


    • Edited by dswinerd Friday, June 19, 2015 6:02 PM
    Friday, June 19, 2015 5:37 PM

Answers

All replies

  •      Hi DsWiNerd,

         First of, make sure you are using the latest certification kit. It fixes a lot of "glitches" when it comes to games done with DirectX.

         Second, XAudio2 is a painful API to use, but, once you get by these little "WTF" moments, it works (sort of). That said, your declaration is different from the recommended documentation. 

         The following is an extract of the code I used for my games:

    ...
    Microsoft::WRL::ComPtr<IXAudio2> sdmXAudio2;
    IXAudio2MasteringVoice *pmvMasterVoice;
    bool blnCreated;
    ...
    void Start()
    {
    	HRESULT hr = S_OK;
    
    	try
    	{
    		hr = XAudio2Create( &sdmXAudio2, 0, XAUDIO2_DEFAULT_PROCESSOR );
    		if (SUCCEEDED(hr))
    		{
    			hr = sdmXAudio2->CreateMasteringVoice( &pmvMasterVoice );
    			if (SUCCEEDED(hr))
    			{
    				blnCreated = true;
    			}
    		}
    	}
    	catch(exception oMyEx)
    	{
    		strErrors = oMyEx.what();
    	}
    }
    

         I know, the guide says something, but  sometimes it doesn't compile, and what not... but these lines of code passed the Certification.

         I hope it helps!!!

         Tarh Ik

    PS: This posting has been posted "AS IS"


    Tarh ik

    Monday, June 22, 2015 3:51 PM
  • The WACK tool likely needs updating. XAudio 2.9 is new to Windows 10, and it is supported for universal Windows apps.

    PS: For example code using XAudio2, see GitHub and DirectX Tool Kit.

    Tuesday, June 23, 2015 3:49 AM
  • Thanks for the answer.  I suspected/hoped the WACK tool needed updating.  

    We're actually using Wwise for audio - the code I provided was just a simple example that would trigger the WACK failure.

    EDIT: can confirm this was fixed in the Windows App Cert Kit that came with the 10158 version of the Windows 10 SDK.
    • Edited by dswinerd Monday, July 13, 2015 5:17 PM Confirm fixed in the new SDK
    Tuesday, June 23, 2015 8:41 PM