Merge pull request #38208 from Calinou/project-manager-use-dummy-audio-driver

Use the Dummy audio driver in the project manager
This commit is contained in:
Thaddeus Crews 2024-10-25 13:04:02 -05:00
commit 9554e3c35b
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84

View File

@ -2499,8 +2499,15 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
GLOBAL_DEF_RST_NOVAL("audio/driver/driver", AudioDriverManager::get_driver(0)->get_name()); GLOBAL_DEF_RST_NOVAL("audio/driver/driver", AudioDriverManager::get_driver(0)->get_name());
if (audio_driver.is_empty()) { // Specified in project.godot. if (audio_driver.is_empty()) { // Specified in project.godot.
if (project_manager) {
// The project manager doesn't need to play sound (TTS audio output is not emitted by Godot, but by the system itself).
// Disable audio output so it doesn't appear in the list of applications outputting sound in the OS.
// On macOS, this also prevents the project manager from inhibiting suspend.
audio_driver = "Dummy";
} else {
audio_driver = GLOBAL_GET("audio/driver/driver"); audio_driver = GLOBAL_GET("audio/driver/driver");
} }
}
// Make sure that dummy is the last one, which it is assumed to be by design. // Make sure that dummy is the last one, which it is assumed to be by design.
DEV_ASSERT(NULL_AUDIO_DRIVER == AudioDriverManager::get_driver(AudioDriverManager::get_driver_count() - 1)->get_name()); DEV_ASSERT(NULL_AUDIO_DRIVER == AudioDriverManager::get_driver(AudioDriverManager::get_driver_count() - 1)->get_name());