|
|
|
|
|
|
|
|
|
|
|
|
|
|
const int NUM_SUPPORTED_VOICES = 55; |
|
|
const int NUM_SUPPORTED_VOICES = 55; |
|
|
|
|
|
|
|
|
/* Integer constants */ |
|
|
|
|
|
const int DEFAULT_SPEECH_RATE = 150; |
|
|
|
|
|
|
|
|
|
|
|
// Callback to the TTS API |
|
|
// Callback to the TTS API |
|
|
synthDoneCB_t *ttsSynthDoneCBPointer; |
|
|
synthDoneCB_t *ttsSynthDoneCBPointer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
espeak_SetSynthCallback(eSpeakCallback); |
|
|
espeak_SetSynthCallback(eSpeakCallback); |
|
|
espeak_SetParameter(espeakRATE, DEFAULT_SPEECH_RATE, 0); |
|
|
|
|
|
|
|
|
|
|
|
espeak_VOICE voice; |
|
|
espeak_VOICE voice; |
|
|
memset(&voice, 0, sizeof(espeak_VOICE)); // Zero out the voice first |
|
|
memset(&voice, 0, sizeof(espeak_VOICE)); // Zero out the voice first |
|
|
|
|
|
|
|
|
// TODO: Set this property |
|
|
// TODO: Set this property |
|
|
result = EE_OK; |
|
|
result = EE_OK; |
|
|
} else if (strncmp(property, "rate", 4) == 0) { |
|
|
} else if (strncmp(property, "rate", 4) == 0) { |
|
|
int rate = atoi(value) * DEFAULT_SPEECH_RATE / 100; |
|
|
|
|
|
|
|
|
int rate = atoi(value) * espeak_GetParameter(espeakRATE, 0) / 100; |
|
|
|
|
|
if (DEBUG) LOGV("setProperty rate : rate=%s, wpm=%d", value, rate); |
|
|
result = espeak_SetParameter(espeakRATE, rate, 0); |
|
|
result = espeak_SetParameter(espeakRATE, rate, 0); |
|
|
} else if (strncmp(property, "pitch", 5) == 0) { |
|
|
} else if (strncmp(property, "pitch", 5) == 0) { |
|
|
int pitch = atoi(value); |
|
|
int pitch = atoi(value); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
return TTS_SUCCESS; |
|
|
return TTS_SUCCESS; |
|
|
} else if (strncmp(property, "rate", 4) == 0) { |
|
|
} else if (strncmp(property, "rate", 4) == 0) { |
|
|
int rate = espeak_GetParameter(espeakRATE, 1) * 100 / DEFAULT_SPEECH_RATE; |
|
|
|
|
|
|
|
|
int rate = espeak_GetParameter(espeakRATE, 1) * 100 / espeak_GetParameter(espeakRATE, 0); |
|
|
char tmprate[4]; |
|
|
char tmprate[4]; |
|
|
sprintf(tmprate, "%d", rate); |
|
|
sprintf(tmprate, "%d", rate); |
|
|
if (*iosize < strlen(tmprate)+1) { |
|
|
if (*iosize < strlen(tmprate)+1) { |