[Linux/BSD] Add dynamically loaded library version checks.

This commit is contained in:
bruvzg 2023-03-16 10:44:47 +02:00
parent 161d028ae8
commit bed46f723c
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38
9 changed files with 160 additions and 11 deletions

View file

@ -48,6 +48,11 @@ void TTS_Linux::speech_init_thread_func(void *p_userdata) {
if (initialize_speechd(dylibloader_verbose) != 0) {
print_verbose("Text-to-Speech: Cannot load Speech Dispatcher library!");
} else {
if (!spd_open || !spd_set_notification_on || !spd_list_synthesis_voices || !free_spd_voices || !spd_set_synthesis_voice || !spd_set_volume || !spd_set_voice_pitch || !spd_set_voice_rate || !spd_set_data_mode || !spd_say || !spd_pause || !spd_resume || !spd_cancel) {
// There's no API to check version, check if functions are available instead.
print_verbose("Text-to-Speech: Unsupported Speech Dispatcher library version!");
return;
}
#else
{
#endif