Don't try to open the mic device every time if SDL says it has none

Fixes the UI hanging up on Windows 11 when there are no mics, but the mic
input is set to external device as it is by default.
This commit is contained in:
Nadia Holmquist Pedersen 2023-07-14 02:10:04 +02:00
parent 0947e941b8
commit ca5e8792c8
1 changed files with 4 additions and 0 deletions

View File

@ -126,6 +126,10 @@ void MicOpen()
return;
}
int numMics = SDL_GetNumAudioDevices(1);
if (numMics == 0)
return;
SDL_AudioSpec whatIwant, whatIget;
memset(&whatIwant, 0, sizeof(SDL_AudioSpec));
whatIwant.freq = 44100;