mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
[Feature] talk.c allow Invalid voice files for selected language
(if it exists) Change-Id: I3aacfc31e3e8a9cac7c9dae0e99c234e43da953a
This commit is contained in:
parent
b4668e2bd6
commit
8cb8a30f9d
1 changed files with 15 additions and 1 deletions
16
apps/talk.c
16
apps/talk.c
|
@ -1587,7 +1587,21 @@ void talk_announce_voice_invalid(void)
|
|||
int buf_handle;
|
||||
struct queue_entry qe;
|
||||
|
||||
const char talkfile[] = LANG_DIR "/InvalidVoice_" DEFAULT_VOICE_LANG ".talk";
|
||||
char talkfile[MAX_PATH];
|
||||
const char* const p_lang_def = DEFAULT_VOICE_LANG; /* default */
|
||||
const char* p_lang = p_lang_def;
|
||||
|
||||
/* attempt to load Invalid voice clip in proper lang otherwise use default */
|
||||
if (global_settings.lang_file[0] && global_settings.lang_file[0] != 0xff)
|
||||
p_lang = global_settings.lang_file;
|
||||
|
||||
while(1)
|
||||
{
|
||||
snprintf(talkfile, sizeof(talkfile), LANG_DIR "/InvalidVoice_%s.talk", p_lang);
|
||||
if (file_exists(talkfile) || p_lang == p_lang_def)
|
||||
break; /* if it exists or default talk file doesn't exist give up */
|
||||
p_lang = p_lang_def;
|
||||
}
|
||||
|
||||
if (global_settings.talk_menu && talk_status != TALK_STATUS_OK)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue