Open DavidKinder opened 5 years ago
How about change the TTS part to make it much more "friendly" and "dynamic" ( allowing you to 'barge in' when what to skip "text speaking" by issuing a command before the end of last "text queued for speaking") and avoid getting bored by listening to the same text "over and over":
typedef enum SPEAKFLAGS {
SPF_ASYNC = (1L<<0),
SPF_PURGEBEFORESPEAK = (1L << 1)
} SPEAKFLAGS;
Add "clock_t m_lastSpoken=0;" just after "static TextToSpeech SpeechEngine;" in GlkTalk.h
Change in "void TextToSpeech::Speak(LPCSTR speech)" and "void TextToSpeech::Speak(LPCWSTR speech)"
if (clock() - m_lastSpoken > CLOCKS_PER_SEC/4) { // 0.25 sec interval
m_Voice->Speak(unicode, SPF_ASYNC | SPF_PURGEBEFORESPEAK, NULL);
}
else {
m_Voice->Speak(unicode, SPF_ASYNC, NULL);
}
m_lastSpoken = clock();
That's all... and have a much better experience with the voice synthesis (I hope).
Suggestions from Nikita Tseykovets:
Add a key press to skip the current sentence, and another key to repeat the last sentence. This needs rules to define what constitutes a sentence, but that should be possible.
Add hotkeys to turn sound on and off, and to control the sound volume, without affecting speech.