diff --git a/homeassistant/components/google_cloud_tts/tts.py b/homeassistant/components/google_cloud_tts/tts.py index 1b84d3f9db0..5d9ea58e8c0 100644 --- a/homeassistant/components/google_cloud_tts/tts.py +++ b/homeassistant/components/google_cloud_tts/tts.py @@ -11,7 +11,7 @@ from google.cloud import texttospeech _LOGGER = logging.getLogger(__name__) GENDERS = [ - 'Female', 'Male', + 'Neutral', 'Female', 'Male', ] DEFAULT_GENDER = GENDERS[0] @@ -94,7 +94,12 @@ class GoogleCloudTTSProvider(Provider): self.voice = texttospeech.types.VoiceSelectionParams( language_code=language or self._lang, name=voice, - ssml_gender=texttospeech.enums.SsmlVoiceGender.FEMALE if gender==GENDERS[0] else texttospeech.enums.SsmlVoiceGender.MALE + ssml_gender= + texttospeech.enums.SsmlVoiceGender.NEUTRAL if gender==GENDERS[0] else + ( + texttospeech.enums.SsmlVoiceGender.FEMALE if gender==GENDERS[1] else + texttospeech.enums.SsmlVoiceGender.MALE + ) ) synthesis_input = texttospeech.types.SynthesisInput(text=message) response = self.client.synthesize_speech(