diff options
author | William Wilgus <wilgus.william@gmail.com> | 2024-06-20 15:19:06 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2024-06-20 16:00:27 -0400 |
commit | 8cb8a30f9d8e87fbd1103abef6447358393cfcd1 (patch) | |
tree | bd483220e03a7dfa8c255fd359469807d0dfc6e9 /apps/talk.c | |
parent | b4668e2bd68fc700ca027d1c77f69b5be960daa6 (diff) | |
download | rockbox-8cb8a30f9d8e87fbd1103abef6447358393cfcd1.tar.gz rockbox-8cb8a30f9d8e87fbd1103abef6447358393cfcd1.zip |
[Feature] talk.c allow Invalid voice files for selected language
(if it exists)
Change-Id: I3aacfc31e3e8a9cac7c9dae0e99c234e43da953a
Diffstat (limited to 'apps/talk.c')
-rw-r--r-- | apps/talk.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/apps/talk.c b/apps/talk.c index fb2f9cf3df..ddc95e697b 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -1587,7 +1587,21 @@ void talk_announce_voice_invalid(void) | |||
1587 | int buf_handle; | 1587 | int buf_handle; |
1588 | struct queue_entry qe; | 1588 | struct queue_entry qe; |
1589 | 1589 | ||
1590 | const char talkfile[] = LANG_DIR "/InvalidVoice_" DEFAULT_VOICE_LANG ".talk"; | 1590 | char talkfile[MAX_PATH]; |
1591 | const char* const p_lang_def = DEFAULT_VOICE_LANG; /* default */ | ||
1592 | const char* p_lang = p_lang_def; | ||
1593 | |||
1594 | /* attempt to load Invalid voice clip in proper lang otherwise use default */ | ||
1595 | if (global_settings.lang_file[0] && global_settings.lang_file[0] != 0xff) | ||
1596 | p_lang = global_settings.lang_file; | ||
1597 | |||
1598 | while(1) | ||
1599 | { | ||
1600 | snprintf(talkfile, sizeof(talkfile), LANG_DIR "/InvalidVoice_%s.talk", p_lang); | ||
1601 | if (file_exists(talkfile) || p_lang == p_lang_def) | ||
1602 | break; /* if it exists or default talk file doesn't exist give up */ | ||
1603 | p_lang = p_lang_def; | ||
1604 | } | ||
1591 | 1605 | ||
1592 | if (global_settings.talk_menu && talk_status != TALK_STATUS_OK) | 1606 | if (global_settings.talk_menu && talk_status != TALK_STATUS_OK) |
1593 | { | 1607 | { |