Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google_translate component ignores punctuation. #43093

Closed
brott8 opened this issue Nov 11, 2020 · 9 comments
Closed

Google_translate component ignores punctuation. #43093

brott8 opened this issue Nov 11, 2020 · 9 comments

Comments

@brott8
Copy link

brott8 commented Nov 11, 2020

The problem

Google translate tts usage through the tts.google_say service ignores punctuation. For example, a message of "It is 5:00pm" generates audio of "It is 5 zero zero pm". If using google translate, we know that Google can generate audio of "It is five pm" from this text. This appears to be because of the "split_message_to_parts" function usage in the code.

Specifically it escapes the punctuation. However, I am unable to determine the reason for this.

punc = "!()[]?.,;:"

Environment

  • Home Assistant Core release with the issue: 0.117.5
  • Last working Home Assistant Core release (if known): None
  • Operating environment (OS/Container/Supervised/Core): Container
  • Integration causing this issue: google_translate
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/google_translate

Problem-relevant configuration.yaml

tts:
  - platform: google_translate
    service_name: google_say

Traceback/Error logs

Additional information

This was discussed briefly here, but never resolved. https://community.home-assistant.io/t/a-stops-tts-google-say-from-further-speech/147069/5

@probot-home-assistant
Copy link

google_translate documentation
google_translate source
(message by IssueLinks)

@brott8
Copy link
Author

brott8 commented Nov 11, 2020

I should note that this oddly does not present an issue when I call the service "tts.google_say" via developer tools. It only becomes an issue when I call it from a template in an automation.

Developer Tools: tts.google_say

entity_id: media_player.main_speaker
message: >
  The current time is 8:00pm. 

Says "The current time is eight pm".

Automation:

      ...
      - service: tts.google_say
        data:
          entity_id: media_player.main_speaker
          message: >
            The current time is {{now().strftime('%-I:%M %p')}}. 

Says "The current time is eleven zero zero pm"

I've tested without the template in the automation with the same output:
message: >
The current time is 11:00pm.

@geejayem99
Copy link

I have a similar problem with temperatures if used in a template in an automation. The decimal points in a temp are (un)pronounced as a pause, ie a full stop then the decimal part of the temp is said. Same as above, if done in developer tools it comes out correctly.

@hmmbob
Copy link
Contributor

hmmbob commented Dec 3, 2020

The logic of the Google Translate integration has changed for the next release (0.119 / 1.0.0, scheduled 13 Dec). Please keep an eye on that release an report back if the issue still arises.

See #43863

@github-actions
Copy link

github-actions bot commented Mar 3, 2021

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Mar 3, 2021
@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Mar 3, 2021

The logic of the Google Translate integration has changed for the next release (0.119 / 1.0.0, scheduled 13 Dec). Please keep an eye on that release an report back if the issue still arises.

See #43863

I now see this reference to the #43863 issue, which brought me back to one of my own findings. Could you please have a look at those too, because they seem to be interrelated? thanks! #47220 #40925

@github-actions github-actions bot removed the stale label Mar 3, 2021
@hmmbob
Copy link
Contributor

hmmbob commented Mar 3, 2021

That has nothing to do with this issue, so please close this one.

@Mariusthvdb
Copy link
Contributor

I cant close this one

@brott8
Copy link
Author

brott8 commented Mar 4, 2021

Got around to testing it on the latest release. Looks like this is fixed.
I've since moved to using the google_cloud integration, and the google_translate voice now sounds like she is drunk (as the google_cloud voice is light years more clear) ;)

I will go ahead and close this issue. Thanks for everyone's work on the massive changes in the 2020.12 release!

@brott8 brott8 closed this as completed Mar 4, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants