Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
Description
The following code returns -1 to dwWaveOutDeviceID when on Windows it actually returns the preferred audio device. Reproduces on commit 28373a9.
#include <cstdio>
|
#include <windows.h>
|
#include <mmsystem.h>
|
|
|
int main(int argc, char** argv[]) { |
WCHAR pszWinMMErrText[MAXERRORLENGTH] = {0}; |
DWORD dwWaveOutDeviceID; |
DWORD dw2; |
|
|
MMRESULT mmres = waveOutMessage((HWAVEOUT)WAVE_MAPPER, 0x2000 + 21, (DWORD_PTR)&dwWaveOutDeviceID, (DWORD_PTR)&dw2); |
if (mmres != MMSYSERR_NOERROR) |
{
|
waveOutGetErrorTextW(mmres, pszWinMMErrText, _countof(pszWinMMErrText));
|
printf("waveOutMessage failed: %lu (%S)\n", mmres, pszWinMMErrText); |
}
|
|
|
if (dwWaveOutDeviceID == -1) |
{
|
printf("No default output device was assigned, falling back to the first device\n"); |
}
|
return 0; |
}
|