main
Bob Mottram 2021-12-13 15:49:28 +00:00
parent 313997cf64
commit 0732419c33
1 changed files with 10 additions and 9 deletions

View File

@ -324,15 +324,16 @@ def _speakerPicospeaker(pitch: int, rate: int, systemLanguage: str,
"""TTS using picospeaker """TTS using picospeaker
""" """
speakerLang = 'en-GB' speakerLang = 'en-GB'
if systemLanguage: supportedLanguages = {
if systemLanguage.startswith('fr'): "fr": "fr-FR",
speakerLang = 'fr-FR' "es": "es-ES",
elif systemLanguage.startswith('es'): "de": "de-DE",
speakerLang = 'es-ES' "it": "it-IT"
elif systemLanguage.startswith('de'): }
speakerLang = 'de-DE' for lang, speakerStr in supportedLanguages.items():
elif systemLanguage.startswith('it'): if systemLanguage.startswith(lang):
speakerLang = 'it-IT' speakerLang = speakerStr
break
sayText = str(sayText).replace('"', "'") sayText = str(sayText).replace('"', "'")
speakerCmd = 'picospeaker ' + \ speakerCmd = 'picospeaker ' + \
'-l ' + speakerLang + \ '-l ' + speakerLang + \