Gracefully fall back to stereo audio if 5.1 doesn't work
This commit is contained in:
parent
98297e0aed
commit
9f0617f6ee
1 changed files with 14 additions and 2 deletions
|
|
@ -512,8 +512,20 @@ bool Session::validateLaunch()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test that audio hardware is functional
|
// Test if audio works at the specified audio configuration
|
||||||
m_AudioDisabled = !testAudio(m_StreamConfig.audioConfiguration);
|
bool audioTestPassed = testAudio(m_StreamConfig.audioConfiguration);
|
||||||
|
|
||||||
|
// Gracefully degrade to stereo if 5.1 doesn't work
|
||||||
|
if (!audioTestPassed && m_StreamConfig.audioConfiguration == AUDIO_CONFIGURATION_51_SURROUND) {
|
||||||
|
audioTestPassed = testAudio(AUDIO_CONFIGURATION_STEREO);
|
||||||
|
if (audioTestPassed) {
|
||||||
|
m_StreamConfig.audioConfiguration = AUDIO_CONFIGURATION_STEREO;
|
||||||
|
emitLaunchWarning("5.1 surround sound is not supported by the current audio device.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If nothing worked, warn the user that audio will not work
|
||||||
|
m_AudioDisabled = !audioTestPassed;
|
||||||
if (m_AudioDisabled) {
|
if (m_AudioDisabled) {
|
||||||
emitLaunchWarning("Failed to open audio device. Audio will be unavailable during this session.");
|
emitLaunchWarning("Failed to open audio device. Audio will be unavailable during this session.");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue