Revert "(Xaudio2) Fix audio device index - since Windows 8, device index"

This reverts commit aeb10505c42c2a581317a7e85ec346a2dacad816.
This commit is contained in:
twinaphex 2019-07-24 05:34:58 +02:00
parent 04772fd8bf
commit 6da7a0c19a

View File

@ -219,16 +219,8 @@ static xaudio2_t *xaudio2_new(unsigned samplerate, unsigned channels,
goto error;
#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)
{
/* Since Windows 8,
* device index is of type LPCWSTR instead of UINT32.
*
* MSDN note: Note that the DirectX SDK XAUDIO2 version of CreateMasteringVoice took a DeviceIndex argument instead of a szDeviceId */
XAUDIO2_DEVICE_DETAILS dev_detail;
IXAudio2_GetDeviceDetails(handle->pXAudio2, device, &dev_detail);
if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, (LPCWSTR)dev_detail.DeviceID, NULL, AudioCategory_GameEffects)))
goto error;
}
if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, (LPCWSTR)(uintptr_t)device, NULL, AudioCategory_GameEffects)))
goto error;
#else
if (FAILED(IXAudio2_CreateMasteringVoice(handle->pXAudio2, &handle->pMasterVoice, channels, samplerate, 0, device, NULL)))
goto error;