Workaround for RtAudio Exception when no Input are connected on MIC IN on some computer

Issue reproduced with Windows11 Pro + ROG CROSSHAIR X670E HERO
Workaround for RtAudio just add try/catch and log the error but allow to start SDR++
pull/1114/head
Benjamin Vernoux 2023-07-02 16:44:47 +02:00
rodzic 8d05c1e181
commit 6cd09f9b60
1 zmienionych plików z 13 dodań i 9 usunięć

Wyświetl plik

@ -45,16 +45,20 @@ public:
int count = audio.getDeviceCount();
RtAudio::DeviceInfo info;
for (int i = 0; i < count; i++) {
info = audio.getDeviceInfo(i);
if (!info.probed) { continue; }
if (info.outputChannels == 0) { continue; }
if (info.isDefaultOutput) { defaultDevId = devList.size(); }
devList.push_back(info);
deviceIds.push_back(i);
txtDevList += info.name;
txtDevList += '\0';
try {
info = audio.getDeviceInfo(i);
if (!info.probed) { continue; }
if (info.outputChannels == 0) { continue; }
if (info.isDefaultOutput) { defaultDevId = devList.size(); }
devList.push_back(info);
deviceIds.push_back(i);
txtDevList += info.name;
txtDevList += '\0';
}
catch (std::exception e) {
flog::error("AudioSinkModule Error getting audio device info: {0}", e.what());
}
}
selectByName(device);
}