AudioIODeviceType::createAudioIODeviceType_WASAPI(false) returns nullptr if running in Wine under Linux.
This is because the getWindowsVersion() function in juce_win32_SystemStats.cpp returns the wrong Windows version number.
Regardless of which version of the Windows environment I am using for Wine simulation (even if it is Windows 10), the version number of kernel32.dll used by wine will be 5.1.2600.2180.
If you match the version number of kernel32.dll to the Windows version number, it will become Windows XP.
Then I see the implementation of the AudioIODeviceType::createAudioIODeviceType_WASAPI method in juce_win32_WASAPI.cpp, using “SystemStats::getOperatingSystemType() >= SystemStats::WinVista” to determine if the Windows version is larger than Vista, obviously it will be false, so This method will return nullptr.
I think this way of judging the Windows version number is unreliable, at least in Wine, it cannot be judged in this way.
Our temporary solution is to change the juce_win32_WASAPI.cpp and change “SystemStats::getOperatingSystemType() >= SystemStats::WinVista” to use the “IsWindowsVistaOrGreater()” method in VersionHelpers.h (of course, juce_audio_devices.cpp Also added “#include <VersionHelpers.h>”).
But I don’t think this is a perfect solution. After all, it doesn’t solve the problem of how to get the Windows version number correctly. Executing “SystemStats::getOperatingSystemName()” in Wine will still return “Windows XP” forever.
So can you fix this problem with a solution that you think is better? After all, there are still many people using Wine to execute Windows applications, so we sincerely hope that this problem can be completely solved.