Selaa lähdekoodia

Document the TTS functionality a bit

Clara Hobbs 7 vuotta sitten
vanhempi
commit
92557c33f9
2 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 3
    1
      kayleevc/plugins/pluginbase.py
  2. 1
    1
      kayleevc/plugins/simple.py

+ 3
- 1
kayleevc/plugins/pluginbase.py Näytä tiedosto

@@ -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 Näytä tiedosto

@@ -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)

Loading…
Peruuta
Tallenna