TTSModule.py 901 B

1234567891011121314151617181920212223242526272829303132
  1. # coding: utf8
  2. import logging
  3. logging.basicConfig()
  4. logger = logging.getLogger("kalliope")
  5. class TTSModule(object):
  6. def __init__(self):
  7. """
  8. Mother class of TTS module. Hnadle:
  9. - Cache: call cache object to create file, delete file, check if file exist
  10. - Player: call the default player to play the generated file
  11. """
  12. def play_audio(self, audio_file_path):
  13. """
  14. :param audio_file_path:
  15. :return:
  16. """
  17. def get_path_to_store_audio(self, text):
  18. """
  19. Call the cache to get the valid path where the TTS module will store the downloaded or generated file
  20. :param text: String text audio we want to save on the local disk
  21. :return:
  22. """
  23. # TODO: question: maybe we can implement function in cache directly in TTSModule as it is its job anyway to do all that stuff?
  24. pass