Browse Source

add comment in function

nico 8 years ago
parent
commit
35b8491ad2
1 changed files with 11 additions and 0 deletions
  1. 11 0
      core/TTS/TTSModule.py

+ 11 - 0
core/TTS/TTSModule.py

@@ -51,6 +51,12 @@ class TTSModule(object):
         Mplayer.play(self.file_path)
 
     def generate_and_play(self, words, generate_audio_function_from_child=None):
+        """
+        Generate an audio file from <words> if not already in cache and call the Player to play it
+        :param words: Sentence text from which we want to generate an audio file
+        :param generate_audio_function_from_child: The child function to generate a file if necessary
+        :return:
+        """
         if generate_audio_function_from_child is None:
             raise TtsGenerateAudioFunctionNotFound
 
@@ -90,6 +96,11 @@ class TTSModule(object):
 
     @staticmethod
     def generate_md5_from_words(words):
+        """
+        Generate a md5 hash from received text
+        :param words: Text to convert into md5 hash
+        :return: String md5 hash from the received words
+        """
         if isinstance(words, unicode):
             words = words.encode('utf-8')
         return hashlib.md5(words).hexdigest()