| // Callback to the TTS API | // Callback to the TTS API | ||||
| synthDoneCB_t *ttsSynthDoneCBPointer; | synthDoneCB_t *ttsSynthDoneCBPointer; | ||||
| char *currentLanguage = (char *) "en-us"; | |||||
| char *currentRate = (char *) "150"; | char *currentRate = (char *) "150"; | ||||
| char *eSpeakDataPath = NULL; | char *eSpeakDataPath = NULL; | ||||
| char currentLanguage[33]; | |||||
| char currentLang[10]; | char currentLang[10]; | ||||
| char currentCountry[10]; | char currentCountry[10]; | ||||
| char currentVariant[10]; | char currentVariant[10]; | ||||
| voice.variant = 0; | voice.variant = 0; | ||||
| espeak_SetVoiceByProperties(&voice); | espeak_SetVoiceByProperties(&voice); | ||||
| strcpy(currentLanguage, "en-us"); | |||||
| hasInitialized = true; | hasInitialized = true; | ||||
| return TTS_SUCCESS; | return TTS_SUCCESS; | ||||
| return TTS_FAILURE; | return TTS_FAILURE; | ||||
| } | } | ||||
| strcpy(currentLanguage, lang); | |||||
| strcpy(currentLang, lang); | strcpy(currentLang, lang); | ||||
| strcpy(currentCountry, country); | strcpy(currentCountry, country); | ||||
| strcpy(currentVariant, variant); | strcpy(currentVariant, variant); | ||||
| voice.variant = 0; | voice.variant = 0; | ||||
| voice.languages = espeakLangStr; | voice.languages = espeakLangStr; | ||||
| espeak_ERROR err = espeak_SetVoiceByProperties(&voice); | espeak_ERROR err = espeak_SetVoiceByProperties(&voice); | ||||
| currentLanguage = new char[strlen(lang)]; | |||||
| strcpy(currentLanguage, lang); | |||||
| if (err != EE_OK) { | if (err != EE_OK) { | ||||
| LOGE("Error code %d when setting voice properties!", err); | LOGE("Error code %d when setting voice properties!", err); |