mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-12-26 02:48:31 +01:00
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++
This commit is contained in:
parent
8d05c1e181
commit
6cd09f9b60
@ -45,16 +45,20 @@ public:
|
|||||||
int count = audio.getDeviceCount();
|
int count = audio.getDeviceCount();
|
||||||
RtAudio::DeviceInfo info;
|
RtAudio::DeviceInfo info;
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
info = audio.getDeviceInfo(i);
|
try {
|
||||||
if (!info.probed) { continue; }
|
info = audio.getDeviceInfo(i);
|
||||||
if (info.outputChannels == 0) { continue; }
|
if (!info.probed) { continue; }
|
||||||
if (info.isDefaultOutput) { defaultDevId = devList.size(); }
|
if (info.outputChannels == 0) { continue; }
|
||||||
devList.push_back(info);
|
if (info.isDefaultOutput) { defaultDevId = devList.size(); }
|
||||||
deviceIds.push_back(i);
|
devList.push_back(info);
|
||||||
txtDevList += info.name;
|
deviceIds.push_back(i);
|
||||||
txtDevList += '\0';
|
txtDevList += info.name;
|
||||||
|
txtDevList += '\0';
|
||||||
|
}
|
||||||
|
catch (std::exception e) {
|
||||||
|
flog::error("AudioSinkModule Error getting audio device info: {0}", e.what());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selectByName(device);
|
selectByName(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user