any change we can get SSML support for Google Cloud Platform Text-to-Speech?
Hi
I managed to get it working by downloading google_cloud from git and placed it in custom_components and then changed the following line in tts.py:
synthesis_input = texttospeech.types.SynthesisInput(text=message)
to:
synthesis_input = texttospeech.types.SynthesisInput(ssml=message)
Now I can use SSML <speak>
tags and if you donāt use SSML tags it works as normal.
thank you very much. It worked great. I just donāt understand why it is not officially supported by HA but Amazon polly is?
Do you happend to have the link to that?
github main Home assistant rep. in the components folder.
here is the link
Okay, this is helpful, but I want to clarify ā¦ Do I need to declare it somewhere in the configuration.yaml as a custom component now or does HA automatically know to reference the custom_component version over the built in if it exists?
No need, HA always runs custom_component first.
This is great!! And indeed, why isnāt it implemented by default, its a 4 character changeā¦
I have downloaded the google_cloud into the custom_components folder and made the necessary edits.
Will someone kindly provide an example of how to use it?
Thanks. Will try it out.
For clarification:
- Go to https://github.com/home-assistant/core > click the green code button > Download Zip
- Unzip the file and copy the core/homeassistant/components/google_cloud folder into <ha_config_folder>/custom_components/google_cloud
- Open <ha_config_folder>/custom_components/google_cloud/tts.py and replace the line:
synthesis_input = texttospeech.types.SynthesisInput(text=message)
with:
synthesis_input = texttospeech.types.SynthesisInput(ssml=message)
- Reboot Home-assistant
- Test it out in Develper Tools > Services
service: tts.google_cloud_say
entity_id: media_player.<your media player>
message: <speak>hello</speak>
Seems to be that 115.5 has broken the ssml. Iāve used it without problems till 115.0ā¦
Saw something on GitHub but the solution seems to be stuck in some approval???
I hope it will be fixed soon as the workaround triggers errors after it worked for a short period.
Pull request : Add google cloud tts SSML + fix by lufton Ā· Pull Request #40203 Ā· home-assistant/core Ā· GitHub has been merged.
You can now simply add text_type: ssml
in your google_cloud configuration.