Initialize TTS, letting the user audition and pick a voice. Returns: None. Sets self.speech to a ready Speech instance.
(self)
| 64 | return True |
| 65 | |
| 66 | def initialize_tts(self): |
| 67 | """Initialize TTS, letting the user audition and pick a voice. |
| 68 | Returns: |
| 69 | None. Sets self.speech to a ready Speech instance. |
| 70 | """ |
| 71 | if self.speech: |
| 72 | return |
| 73 | |
| 74 | animate_thinking("Initializing text-to-speech...", color="status") |
| 75 | language = self.get_spoken_language() |
| 76 | voice_idx = self._select_voice_interactively(language) |
| 77 | self.speech = Speech(enable=self.tts_enabled, |
| 78 | language=language, |
| 79 | voice_idx=voice_idx) |
| 80 | self.speech.speak("Voice confirmed. We are online and ready.") |
| 81 | |
| 82 | |
| 83 | def _select_voice_interactively(self, language): |
no test coverage detected