浏览代码

[Doc] Docstrings of STT package

monf 8 年之前
父节点
当前提交
6f87d36b9c
共有 5 个文件被更改,包括 42 次插入35 次删除
  1. 9 7
      stt/apiai/Apiai.py
  2. 9 7
      stt/bing/Bing.py
  3. 8 7
      stt/google/Google.py
  4. 8 7
      stt/houndify/Houndify.py
  5. 8 7
      stt/wit/Wit.py

+ 9 - 7
stt/apiai/Apiai.py

@@ -8,16 +8,13 @@ class Apiai(OrderListener):
 
     def __init__(self, callback=None, **kwargs):
         """
-        Start recording the microphone and analyse audio with Apiai api
-        :param callback: The callback function to call to send the text
-        :param kwargs:
+            Start recording the microphone and analyse audio with Apiai api
+            :param callback: The callback function to call to send the text
+            :param kwargs:
+
         """
         OrderListener.__init__(self)
 
-        """
-        Start recording the microphone
-        :return:
-        """
         # callback function to call after the translation speech/tex
         self.callback = callback
         # obtain audio from the microphone
@@ -46,6 +43,11 @@ class Apiai(OrderListener):
             Utils.print_danger("Could not request results from Apiai Speech Recognition service; {0}".format(e))
 
     def _analyse_audio(self, audio):
+
+        """
+            Confirm the audio exists annd run it in a Callback
+            :param audio: the captured audio
+        """
         # if self.main_controller is not None:
         #     self.main_controller.analyse_order(audio)
         if self.callback is not None:

+ 9 - 7
stt/bing/Bing.py

@@ -8,16 +8,13 @@ class Bing(OrderListener):
 
     def __init__(self, callback=None, **kwargs):
         """
-        Start recording the microphone and analyse audio with Bing api
-        :param callback: The callback function to call to send the text
-        :param kwargs:
+            Start recording the microphone and analyse audio with Bing api
+            :param callback: The callback function to call to send the text
+            :param kwargs:
         """
         OrderListener.__init__(self)
 
-        """
-        Start recording the microphone
-        :return:
-        """
+
         # callback function to call after the translation speech/tex
         self.callback = callback
         # obtain audio from the microphone
@@ -45,6 +42,11 @@ class Bing(OrderListener):
             Utils.print_danger("Could not request results from Bing Speech Recognition service; {0}".format(e))
 
     def _analyse_audio(self, audio):
+        """
+            Confirm the audio exists annd run it in a Callback
+            :param audio: the captured audio
+        """
+
         # if self.main_controller is not None:
         #     self.main_controller.analyse_order(audio)
         if self.callback is not None:

+ 8 - 7
stt/google/Google.py

@@ -8,16 +8,12 @@ class Google(OrderListener):
 
     def __init__(self, callback=None, **kwargs):
         """
-        Start recording the microphone and analyse audio with google api
-        :param callback: The callback function to call to send the text
-        :param kwargs:
+            Start recording the microphone and analyse audio with google api
+            :param callback: The callback function to call to send the text
+            :param kwargs:
         """
         OrderListener.__init__(self)
 
-        """
-        Start recording the microphone
-        :return:
-        """
         # callback function to call after the translation speech/tex
         self.callback = callback
         # obtain audio from the microphone
@@ -48,6 +44,11 @@ class Google(OrderListener):
             Utils.print_danger("Could not request results from Google Speech Recognition service; {0}".format(e))
 
     def _analyse_audio(self, audio):
+        """
+            Confirm the audio exists annd run it in a Callback
+            :param audio: the captured audio
+        """
+
         # if self.main_controller is not None:
         #     self.main_controller.analyse_order(audio)
         if self.callback is not None:

+ 8 - 7
stt/houndify/Houndify.py

@@ -8,16 +8,12 @@ class Houndify(OrderListener):
 
     def __init__(self, callback=None, **kwargs):
         """
-        Start recording the microphone and analyse audio with Houndify api
-        :param callback: The callback function to call to send the text
-        :param kwargs:
+            Start recording the microphone and analyse audio with Houndify api
+            :param callback: The callback function to call to send the text
+            :param kwargs:
         """
         OrderListener.__init__(self)
 
-        """
-        Start recording the microphone
-        :return:
-        """
         # callback function to call after the translation speech/tex
         self.callback = callback
         # obtain audio from the microphone
@@ -47,6 +43,11 @@ class Houndify(OrderListener):
             Utils.print_danger("Could not request results from Houndify Speech Recognition service; {0}".format(e))
 
     def _analyse_audio(self, audio):
+        """
+            Confirm the audio exists annd run it in a Callback
+            :param audio: the captured audio
+        """
+
         # if self.main_controller is not None:
         #     self.main_controller.analyse_order(audio)
         if self.callback is not None:

+ 8 - 7
stt/wit/Wit.py

@@ -8,16 +8,12 @@ class Wit(OrderListener):
 
     def __init__(self, callback=None, **kwargs):
         """
-        Start recording the microphone and analyse audio with Wit.ai api
-        :param callback: The callback function to call to send the text
-        :param kwargs:
+            Start recording the microphone and analyse audio with Wit.ai api
+            :param callback: The callback function to call to send the text
+            :param kwargs:
         """
         OrderListener.__init__(self)
 
-        """
-        Start recording the microphone
-        :return:
-        """
         # callback function to call after the translation speech/tex
         self.callback = callback
         # obtain audio from the microphone
@@ -43,6 +39,11 @@ class Wit(OrderListener):
             Utils.print_danger("Could not request results from Wit.ai Speech Recognition service; {0}".format(e))
 
     def _analyse_audio(self, audio):
+        """
+            Confirm the audio exists annd run it in a Callback
+            :param audio: the captured audio
+        """
+
         # if self.main_controller is not None:
         #     self.main_controller.analyse_order(audio)
         if self.callback is not None: