| opt.value = voice.identifier; | opt.value = voice.identifier; | ||||
| console.log('Adding voice: ' + opt.text); | console.log('Adding voice: ' + opt.text); | ||||
| sel.add(opt); | sel.add(opt); | ||||
| if (voice.name === 'default') { | |||||
| if (voice.name === 'en') { | |||||
| opt.id = 'default-voice'; | opt.id = 'default-voice'; | ||||
| opt.selected = true; | opt.selected = true; | ||||
| } | } |
| name default | |||||
| language en | |||||
| gender male | |||||
| } | } | ||||
| if (voicename[0] == 0) | if (voicename[0] == 0) | ||||
| strcpy(voicename, "default"); | |||||
| strcpy(voicename, "en"); | |||||
| result = espeak_ng_SetVoiceByName(voicename); | result = espeak_ng_SetVoiceByName(voicename); | ||||
| if (result != ENS_OK) { | if (result != ENS_OK) { |
| return NULL; | return NULL; | ||||
| } else { | } else { | ||||
| if (voicename[0] == 0) | if (voicename[0] == 0) | ||||
| strcpy(voicename, "default"); | |||||
| strcpy(voicename, "en"); | |||||
| sprintf(path_voices, "%s%cvoices%c", path_home, PATHSEP, PATHSEP); | sprintf(path_voices, "%s%cvoices%c", path_home, PATHSEP, PATHSEP); | ||||
| sprintf(buf, "%s%s", path_voices, voicename); // look in the main voices directory | sprintf(buf, "%s%s", path_voices, voicename); // look in the main voices directory |