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

[RU] Assistant doesn't pronounce "minus" in response when the temperature is negative #1683

Open
dimmer123 opened this issue Nov 28, 2023 · 10 comments
Assignees
Labels
bug Something isn't working lang: ru

Comments

@dimmer123
Copy link

dimmer123 commented Nov 28, 2023

Assistant doesn't pronounce "minus" in response in russian when the temperature is negative. In english it pronounces right with "minus".

@tetele
Copy link
Contributor

tetele commented Nov 29, 2023

That's probably an issue with your TTS engine. Have you tried any other TTS?

@tetele
Copy link
Contributor

tetele commented Dec 4, 2023

Encountered the same issue for Romanian, fixed it like this #1706

cc @HepoH3

@HepoH3
Copy link
Member

HepoH3 commented Dec 5, 2023

Encountered the same issue for Romanian, fixed it like this #1706

cc @HepoH3

Thank you for tagging me in! I'll check it out this week.

@HepoH3 HepoH3 added bug Something isn't working lang: ru labels Dec 5, 2023
@HepoH3 HepoH3 self-assigned this Dec 5, 2023
@v1k70rk4
Copy link
Member

Although I'm not Russian, I struggle with this too...

None of my TTS systems read out loud when there is a "-" sign... in fact, they also fail to recognize decimal points in such cases.

That is, instead of saying "minus one point two" for -1.2, it says "one two."

I tried with a dot (.) and a comma (,) and a space before the "-" (- 1.2) but none of these work.

This would solve the problem:

{% set temp = state.attributes.get('temperature') %}
{% if temp is number and temp < 0 %}
  {% set temp = "mínusz " ~ temp|string|replace("-", "") %}
{% endif %}
{{ temp }} {{ state.attributes.get('temperature_unit') }} {{ weather_condition.get((state.attributes.get('untranslated_state') | string).lower(), "") }}

but it's not very elegant :) What do you think?

@joel-bourquard
Copy link

Same issue with French, using Piper TTS (latest version as of 2024-02-09).

@v1k70rk4
Copy link
Member

v1k70rk4 commented Mar 5, 2024

@joel-bourquard @HepoH3
the solution below has been successfully tested and works well. It addresses the issue with negative numbers, the decimal comma issue, and even the weather status is functioning.
#2038

@joel-bourquard
Copy link

Hi @v1k70rk4 , thanks for the good news!
If I understand right, the change has been merged but it only covers the Hungarian language?

@v1k70rk4
Copy link
Member

v1k70rk4 commented Mar 5, 2024

@joel-bourquard Well, unfortunately, this varies by country, who uses '.' or ',' and how they say the minus sign, so yes, this has to be done country by country. But there are languages where this is not a problem for the TTS.

Unfortunately, Hungarian is such a language :) not only is our grammar extremely complicated, but the TTS software is also very sensitive :)

HepoH3 added a commit to HepoH3/intents that referenced this issue Mar 9, 2024
In russian language TTS doesn't handle negative values correctly and
thus does not pronounce word "minus".

In order to fix this problem, temperature value is checked before
response and if it's negative, word “minus” is added at the response
begining.

This fix addressing home-assistant#1683 and has been ported from home-assistant#2038.
HepoH3 added a commit that referenced this issue Mar 9, 2024
In russian language TTS doesn't handle negative values correctly and
thus does not pronounce word "minus".

In order to fix this problem, temperature value is checked before
response and if it's negative, word “minus” is added at the response
begining.

This fix addressing #1683 and has been ported from #2038.
@HepoH3
Copy link
Member

HepoH3 commented Mar 9, 2024

@v1k70rk4, thank you very much!

@HepoH3
Copy link
Member

HepoH3 commented Mar 15, 2024

@dimmer123, could you check if the problem is resolved?

schizza pushed a commit to schizza/intents that referenced this issue Mar 16, 2024
In russian language TTS doesn't handle negative values correctly and
thus does not pronounce word "minus".

In order to fix this problem, temperature value is checked before
response and if it's negative, word “minus” is added at the response
begining.

This fix addressing home-assistant#1683 and has been ported from home-assistant#2038.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lang: ru
Projects
None yet
Development

No branches or pull requests

5 participants