I wanted to give XAUDIO2 a shot and after compilation I got missing xaudio2_8.dll errors on my windows 7 system.
I use VS 2012 Express and the win8 SDK, as recommended by MS for DirectX 11 development.
After a few Google searches and articles read it seems that this is normal as it's a Windows 8 dll not found on a 7 system.
Apparently, the solution to target "down" is to include the xaudio.h header file from the June 2010 SDK. Now, I don't want to undo all my efforts to forget about this SDK and legacy D3DX cruft and add the June 2010 SDK again to my VC++ include directories because then it will again include the wrong stuff for everything else and I will again get macro redifinition warnings which I believe are only the top of an iceberg of other hidden problems. I googled further and found this solution:
#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/) #include <xaudio2.h> #pragma comment(lib,"xaudio2.lib") #else #include <C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\comdecl.h> #include <C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xaudio2.h> #endif