diff --git a/OpenUtau.Core/Audio/MiniAudioOutput.cs b/OpenUtau.Core/Audio/MiniAudioOutput.cs index 49ed1381f..feb50d0e2 100644 --- a/OpenUtau.Core/Audio/MiniAudioOutput.cs +++ b/OpenUtau.Core/Audio/MiniAudioOutput.cs @@ -34,7 +34,19 @@ public MiniAudioOutput() { if (Guid.TryParse(Preferences.Default.PlaybackDevice, out var guid)) { SelectDevice(guid, Preferences.Default.PlaybackDeviceNumber); } else { - SelectDevice(devices[0].guid, devices[0].deviceNumber); + bool foundDevice = false; + foreach (AudioOutputDevice dev in devices) { + try { + SelectDevice(dev.guid, dev.deviceNumber); + foundDevice = true; + break; + } catch (Exception e) { + Log.Warning(e, $"Failed to init audio device {dev}"); + } + } + if (!foundDevice) { + throw new Exception("Failed to init any audio device"); + } } }