int Aisound::PlayText(const char* words) { BEGINFUNC_USING_BY_VOICE int i = 0; char cStr[512]; sprintf(cStr, "¡£%s", words); OpenAG: if(handle != NULL) Release_Pcm(); // usleep(30000); if(Open_Pcm() < 0) { if(i < 5) { i++; Release_Pcm(); goto OpenAG; } else { dbug_out("Open Pcm ERROR...."); return -1; } } sleep(1); ivTTS_SynthText(hTTS, ivText(cStr), -1); return 0; ENDFUNC_USING_BY_VOICE }
bool AISound::synthText(const QString & text) { stop_ = false; data_.clear(); #ifdef BUILD_FOR_ARM // Make sure the tts has been correctly initialized. ivTTSErrID ivReturn = ivTTS_ERR_OK; ivReturn = ivTTS_SynthText(handle_, ivText(text.toUtf8().data()), -1); #endif emit synthDone(true, data_); return true; }