Add microphone combobox using SDL (#1709)

This commit is contained in:
falsidge
2023-06-27 12:31:41 -07:00
committed by GitHub
parent 4b32fb802c
commit 52d6265b58
5 changed files with 36 additions and 2 deletions

View File

@ -133,7 +133,12 @@ void MicOpen()
whatIwant.channels = 1;
whatIwant.samples = 1024;
whatIwant.callback = MicCallback;
micDevice = SDL_OpenAudioDevice(NULL, 1, &whatIwant, &whatIget, 0);
const char* mic = NULL;
if (Config::MicDevice != "")
{
mic = Config::MicDevice.c_str();
}
micDevice = SDL_OpenAudioDevice(mic, 1, &whatIwant, &whatIget, 0);
if (!micDevice)
{
Platform::Log(Platform::LogLevel::Error, "Mic init failed: %s\n", SDL_GetError());