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

LUA playNumber with PREC2 - last decimal digit missing #5480

Open
1 task done
NafetsRC opened this issue Aug 25, 2024 · 5 comments
Open
1 task done

LUA playNumber with PREC2 - last decimal digit missing #5480

NafetsRC opened this issue Aug 25, 2024 · 5 comments
Labels
bug 🪲 Something isn't working triage Bug report awaiting review / sorting

Comments

@NafetsRC
Copy link

Is there an existing issue for this problem?

  • I have searched the existing issues

What part of EdgeTX is the focus of this bug?

Transmitter firmware

Current Behavior

playNumber(123, 1, PREC2) says: „one point two volts“

Expected Behavior

should say: „one point two three volts“ or ‚twentythree‘

Steps To Reproduce

Put this line in a function LUA

same behavior in v2.9.4 AND v2.10.3

Version

2.10.3

Transmitter

RadioMaster TX16S / TX16SMK2

Operating System (OS)

No response

OS Version

No response

Anything else?

No response

@NafetsRC NafetsRC added bug 🪲 Something isn't working triage Bug report awaiting review / sorting labels Aug 25, 2024
@NafetsRC NafetsRC changed the title LUA playNumber with PREC2 - last decimal missing LUA playNumber with PREC2 - last decimal digit missing Aug 25, 2024
@3djc
Copy link
Collaborator

3djc commented Aug 25, 2024

The TTS engine is currently only generating audio with 1 digit after the coma. That dates OpenTX, and is designed to keep a balance between accuracy and annoyance of too long audio speech.

Since you are un LUA, you can easy write a function that does what you want, without altering other users sound behavior

@NafetsRC
Copy link
Author

Thanks 4 Info !

@pfeerick
Copy link
Member

pfeerick commented Aug 26, 2024

So this is actually a bug that has been present in OTX since 2.0.0? As it doesn't match the codes own documentation ;)

https://github.com/opentx/opentx/blob/70867aaeb56c45ca2026df911d5b7434825e3888/radio/src/lua/api_general.cpp#L1111-L1124

We really should either fix that in code in our side (i.e. special handling if PREC2 param given), or remove

  • PREC2 plays a number with two decimal places (for a number 123 it plays 1.23)

from the documentation and code ;)

@3djc
Copy link
Collaborator

3djc commented Aug 26, 2024

PREC is needed to as a divider for the value, but doesn’t drive how many digits will be said. Yes it is a bug in the documentation imho.

@NafetsRC
Copy link
Author

We really should either fix that in code in our side (i.e. special handling if PREC2 param given), or remove

  • PREC2 plays a number with two decimal places (for a number 123 it plays 1.23)

from the documentation and code ;)

Think, this would be really a great idea !!!

There are also some other people, who where misleaded from this…

cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working triage Bug report awaiting review / sorting
Projects
None yet
Development

No branches or pull requests

3 participants