TTS.py 372 B

1234567891011
  1. from core import AudioPlayer
  2. from core import Cache
  3. class TTS:
  4. def __init__(self, audio_player_type=None):
  5. self.cache = Cache(module_name=self.__class__.__name__)
  6. self.audio_player = AudioPlayer(audio_player_type)
  7. def play_audio(self, music_file, volume=0.8, keep_file=False):
  8. self.audio_player.play_audio(music_file, volume, keep_file)