DRASCULA: Add text-to-speech (TTS)#6526
Conversation
criezy
left a comment
There was a problem hiding this comment.
This is a very good start.
I made a couple of comments.
There are also a few more places that I think could benefit from TTS in this game:
- To help visually impaired players we could speak the selected verb when switching between verbs using the F1 to F6 keys (even though the text is not shown on screen).
- We could add TTS on the options dialog shown with F9.
engines/drascula/converse.cpp
Outdated
| if (ConfMan.getBool("tts_enabled") && ttsMan != nullptr && phrase1 != _previousSaid) { | ||
| _previousSaid = phrase1; | ||
| ttsMan->say(phrase1); | ||
| } |
There was a problem hiding this comment.
Can you also comment on the reason why you are tracking the last spoken sentence with _previousSaid (here and in other places) rather than use Common::TextToSpeechManager::INTERRUPT_NO_REPEAT?
There is a slight difference between the two behaviours, but I am not sure it is intentional.
There was a problem hiding this comment.
The issue I had with using only Common::TextToSpeechManager::INTERRUPT_NO_REPEAT was that, because these ttsMan->say(...) calls were inside loops, once the initial speech finished, the text-to-speech manager would see that there was currently no speech and repeat it again. This resulted in endless looping of the same speech for as long as the user was hovered over an option or object, for example. I thought that this endless looping was unintuitive, and I could not always find a place where the text to be spoken was not in a loop, so I used this method of tracking the previous sentence instead. To still allow for appropriate repeat requests, I tried to clear or override _previousSaid when possible.
There was a problem hiding this comment.
Thank you for the explanation. It makes sense. I think we indeed do not want to have the text repeated again and again in a loop when the cursor stays on that text. I will take another look at the changes with that in mind in a few days.
And adding a comment to explain this could be useful since it confused both myself and @sev- .
|
@ellm135 any updates? |
engines/drascula/graphics.cpp
Outdated
| color_abc(kColorLightGreen); | ||
| if (_hasName && !_menuScreen) | ||
| if (_hasName && !_menuScreen) { | ||
| if (_previousSaid != textName) { |
There was a problem hiding this comment.
It is the same problem as in another, more recent PR. You need to check here that TTS is pronouncing text still, and if it is not saying, then still say the phrase. Otherwise, if two consequent request have the same phrase, e.g. when a player clicks on the same item twice in a row, the second phrase will be not pronounced.
engines/drascula/interface.cpp
Outdated
|
|
||
| Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager(); | ||
| if (ConfMan.getBool("tts_enabled") && ttsMan != nullptr) { | ||
| ttsMan->say(_textsys[1]); |
There was a problem hiding this comment.
It would be better replace 1 with something like VERB_LOOK or similarly named constant
criezy
left a comment
There was a problem hiding this comment.
I just made one small suggestion. But otherwise it looks good to me now.
engines/drascula/drascula.cpp
Outdated
| // _previousSaid is used to prevent the TTS from looping when sayText is called inside a loop | ||
| // (Once the text ends, it will see that there is currently no speech and speak the same text again) | ||
| // _previousSaid is cleared when appropriate to allow for repeat requests |
There was a problem hiding this comment.
| // _previousSaid is used to prevent the TTS from looping when sayText is called inside a loop | |
| // (Once the text ends, it will see that there is currently no speech and speak the same text again) | |
| // _previousSaid is cleared when appropriate to allow for repeat requests | |
| // _previousSaid is used to prevent the TTS from looping when sayText is called inside a loop, | |
| // for example when the cursor stays on a verb icon. Without it when the text ends it would speak | |
| // the same text again. | |
| // _previousSaid is cleared when appropriate to allow for repeat requests |
Suggestion to given an example to clarify what "called inside a loop" means.
|
Thank you. It looks all good now. |
Adds a toggle for text-to-speech under the game options.
Adds text-to-speech for the following: