언어 설정

Menu
Sites
Language
TTS

using namespcae Tizen::Uix::Speech;
Speak(readtext, TEXT_TO_SPEECH_REQUEST_MODE_REPLACE);
I want it to stop after speaking the readtext but it does not stop it keeps on repeating. Changing mode dosen't help.

Responses

7 댓글

Couldn't reproduce such repetition problem. Implemented the code according the example in the help contents and it is read only once. Tried in both REPLACE and APPEND modes.

hi hgw7, its repeting every time.

I've created a native service project which can be used to speak out the text. Its working but it keeps on repeating instead of stopping after the completion.

I tried this but it never speaks

if(pTts->GetCurrentStatus() == TEXT_TO_SPEECH_STATUS_READY)
 pTts->Speak(readtext, TEXT_TO_SPEECH_REQUEST_MODE_REPLACE);

So, moved it into OnTextToSpeechStatusChanged. Doing this it works but it keep on speaking the same text in loop. I think when speak() is called inside OnTextToSpeechStatusChanged  after it completes status is again set to TEXT_TO_SPEECH_STATUS_READY  and so it falls in loop.

I want it to speak and stop but can't find how to do it. Help me in finding solution. Thank you

This is because OnTextToSpeechStatusChanged() is called repeatedly. 

After pTts->Initialize(), OnTextToSpeechInitialized() callback gets invoked. Then OnTextToSpeechStatusChanged() is called, and the status of pTts is TEXT_TO_SPEECH_STATUS_READY. 

When pTts->Speak() is called, the OnTextToSpeechStatusChanged() callback gets invoked again, and the status changes to TEXT_TO_SPEECH_STATUS_SYNTHESIZING, and then to TEXT_TO_SPEECH_STATUS_PLAYING when OnTextToSpeechStatusChanged() callback gets invoked again.

Then OnTextToSpeechCompleted() gets invoked and the status changes back to TEXT_TO_SPEECH_STATUS_READY, when OnTextToSpeechStatusChanged() is called again.

Hence, the looping occurs if you write pTts->Speak() in OnTextToSpeechStatusChanged() callback.

thank you hgw7, now you understand my problem help me to find some solution

You just have to call 'pTts->Speak()' elsewhere, and it'l solve the problem. I tested a sample application from the basic template generated in a form based application, and called Speak() from OnActionEventListener(). The text was read once when i pressed the 'OK' button.

pika

Excellent stuff; I'll let my friends know about it and have them check it out. I appreciate you sharing! Whenever you have more time, go to: 

Mark Miller

I must say that your post is very intriguing. I've spent a significant amount of my free time reading your stuff