Posted: 7th Feb 2021 0:48
I am trying to build a Tier2 library using VS2017
I have used nuget to install the Microsoft Xaudio2 for the xaudio2.h include but i am getting the following error
syntax error: identifier 'AUDIO_STREAM_CATEGORY' in WindowCore.cpp at this piece of code (Around line 510)

+ Code Snippet
STDMETHOD(CreateMasteringVoice) (THIS_ _Outptr_ IXAudio2MasteringVoice** ppMasteringVoice,
                                     UINT32 InputChannels X2DEFAULT(XAUDIO2_DEFAULT_CHANNELS),
                                     UINT32 InputSampleRate X2DEFAULT(XAUDIO2_DEFAULT_SAMPLERATE),
                                     UINT32 Flags X2DEFAULT(0), _In_opt_z_ LPCWSTR szDeviceId X2DEFAULT(NULL),
                                     _In_opt_ const XAUDIO2_EFFECT_CHAIN* pEffectChain X2DEFAULT(NULL),
                                    _In_ AUDIO_STREAM_CATEGORY StreamCategory X2DEFAULT(AudioCategory_GameEffects)) PURE;


Does anyone know how i might solve this issue?
Posted: 7th Feb 2021 7:24
AUDIO_STREAM_CATEGORY is defined in audiosessiontypes.h (include Audioclient.h) thist is supported in winsdk-10.
Perhaps you should change the common project settings of the Windows SDK version to 10.x.xxxxx.x.
Posted: 7th Feb 2021 22:38
Thank you very much for your response Mr Bit.
Could you proint me to where in Visual Studio i can make that change?
Posted: 8th Feb 2021 18:22
Right Click your Project.


Choose properties.


Under Common, in the right half of the window, you can set the sdk version.
Posted: 8th Feb 2021 19:30
Unfortunately my vs2015 does not have that option.
Traget platform has no topions as does target platform version
Posted: 8th Feb 2021 20:23
This is because of the Windows XP support in the Platform Toolset option. (Same window 7 line down)
Posted: 8th Feb 2021 22:26
Thanks again for helping me out Mr Bit. I really appreciate it

Do you know which option i should select?
Posted: 9th Feb 2021 4:47
What you have chosen is ok.
But didn't you say you were using VS 2017?
Posted: 9th Feb 2021 6:50
I have the same issues with both.
When i try change the Windows SDK version on vs2017 it won't let me change it to anyting other than 7.0
I have installed windows SDK 10.0
I am at a loss. I would normally completely uninstalll everything and reinstall but i have other development SDK's that i need

I will see if i can manage a complete uninstall/reinstall.

Thank you very much for your help
Posted: 25th Feb 2021 22:25
Hey blinkok, The issue is DirectX, install the DXSDK and it will compile, a tonne of warnings but no errors

Did you follow the guide?

How-to-compile-AppGameKit-Tier2-libraries

I was getting the same results as you, then I read the guide lol
Posted: 26th Feb 2021 0:47
I thought i did.
I will try that.
Is that 2015 or 2017?
Posted: 26th Feb 2021 2:07
it works for both versions, once the DX paths are set your good to go.
Posted: 26th Feb 2021 4:34
XAudio2 within the Windows SDK (which includes DirectX 10 in Windows 7 onward) is different to XAudio2 in the DirectX 9 SDK.
Functionally they're the same, but they're defined / initialised differently meaning they're not compatible without changing the references...

This is actually fine in Dark BASIC Professional (GameGuru) Source, as you have access to said definitions; but with AppGameKit "Tier 2" all of that is handled within the Platform Static Lib.
Although if you look at Common.h., every OTHER Platform clearly uses OpenAL; which Windows could also be using.

Why they've made extra work for themselves by using XAudio on Windows is baffling to me.
I mean if they're going to rewrite the Audio Backend to be Windows Specific., why not switch to using DirectX 12 instead of Vulkan for the Graphics, Maths, etc.?

Yet even still the fact that they rely on a Deprecated VERSION of the DirectX SDK (which as noted is now part of the Windows SDK, with XAudio Support still; but it's handled differently to load), well that just has me scratching my head more.
The reliance of the DBP Source on the DirectX 9 SDK is one of the key factors that makes it SO difficult to simply Open > Build the Source., as that SDK isn't exactly "Compatible" with Visual Studio 2015 onward or Windows 8 onward.
But at least there it makes sense, as it was built on that and changing it is a MAJOR rewrite of the Code... as you essentially rewriting huge chunks of almost every Library and the Core.

Where-as for AGK... I can't imagine it'd be more than a 30min Fix to switch to either the Windows SDK version of XAudio.h, or OpenAL.