|
@@ -5,7 +5,6 @@ import logging
|
|
import os
|
|
import os
|
|
import requests
|
|
import requests
|
|
import sys
|
|
import sys
|
|
-import re
|
|
|
|
from core import FileManager
|
|
from core import FileManager
|
|
|
|
|
|
logging.basicConfig()
|
|
logging.basicConfig()
|
|
@@ -25,7 +24,12 @@ class TTS:
|
|
def say_generic(self, cache, language, words, get_audio_specific, audio_type, audio_frequency, voice=None):
|
|
def say_generic(self, cache, language, words, get_audio_specific, audio_type, audio_frequency, voice=None):
|
|
file_path = self.cache.get_audio_file_cache_path(words, language, voice)
|
|
file_path = self.cache.get_audio_file_cache_path(words, language, voice)
|
|
|
|
|
|
- if get_audio_specific(language, words, file_path, cache, voice):
|
|
|
|
|
|
+ if voice is None:
|
|
|
|
+ return_code = get_audio_specific(language, words, file_path, cache)
|
|
|
|
+ else:
|
|
|
|
+ return_code = get_audio_specific(language, words, file_path, cache, voice)
|
|
|
|
+
|
|
|
|
+ if return_code:
|
|
self.play_audio(file_path, audio_type, audio_frequency, cache)
|
|
self.play_audio(file_path, audio_type, audio_frequency, cache)
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|