Bladeren bron

Document the TTS functionality a bit

Clara Hobbs 7 jaren geleden
bovenliggende
commit
92557c33f9
2 gewijzigde bestanden met toevoegingen van 4 en 2 verwijderingen
  1. 3
    1
      kayleevc/plugins/pluginbase.py
  2. 1
    1
      kayleevc/plugins/simple.py

+ 3
- 1
kayleevc/plugins/pluginbase.py Bestand weergeven

@@ -40,6 +40,8 @@ class PluginBase(GObject.Object):
40 40
         This method must return True if the command was handled by the plugin,
41 41
         and False otherwise.  As soon as it has been determined that the
42 42
         command will be handled, this method must emit a ``processed`` signal
43
-        with ``text`` as its parameter.
43
+        with ``text`` as its parameter.  If the plugin wants to speak some
44
+        words to the user, it can do so by emitting a ``tts`` signal with the
45
+        words to be spoken as its parameter.
44 46
         """
45 47
         return False

+ 1
- 1
kayleevc/plugins/simple.py Bestand weergeven

@@ -24,7 +24,7 @@ class Plugin(PluginBase):
24 24
         self.corpus_strings.add(self.options['phrase'])
25 25
 
26 26
     def recognizer_finished(self, recognizer, text):
27
-        """Print the phrase when it is spoken"""
27
+        """Print and speak the phrase when it is heard"""
28 28
         # Is there a matching command?
29 29
         if text == self.options['phrase']:
30 30
             self.emit('processed', text)

Laden…
Annuleren
Opslaan