add my fixes

This commit is contained in:
Wlad
2023-04-12 10:56:54 +02:00
parent edf364efe8
commit 4063483b87
3 changed files with 15 additions and 9 deletions

View File

@@ -46,15 +46,21 @@ def gtts_speech(text):
playsound("speech.mp3", True)
os.remove("speech.mp3")
def macos_tts_speech(text):
os.system(f'say "{text}"')
def macos_tts_speech(text, voice_index=0):
if voice_index == 0:
os.system(f'say "{text}"')
else:
if voice_index == 1:
os.system(f'say -v "Ava (Premium)" "{text}"')
else:
os.system(f'say -v Samantha "{text}"')
def say_text(text, voice_index=0):
def speak():
if not cfg.elevenlabs_api_key:
if cfg.use_mac_os_tts == 'True':
macos_tts_speech(text)
macos_tts_speech(text, voice_index)
else:
gtts_speech(text)
else: