Android Samsung text-to-speech bug for amount of money reading

Hello! We are improving accessibility for Talkback in our android app.

Faced with the problem of voice acting through Samsung TTS and simple android TextView with the formatted text for example “1 000 ₽”, what must reading as “one thousand russian roubles”. Samsung TTS engine reads his incorrect as “one zero zero zero” and ignores the currency.

Code snippet to reproduce the problem:

  <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="1 000 ₽"
        android:importantForAccessibility="yes"
        />

But Google Text-To-Speech reads it correctly as “one thousand rubles”.

Also we tried solution with TtsSpan and this did not help for Samsung TTS engine:

val amountText = "1 000 Р"
val ttsspan = TtsSpan.MoneyBuilder().setCurrency("RUB").setIntegerPart(1000L).build()
val spannable = SpannableString(amountText)
spannable.setSpan(ttsspan, 0, amountText.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
findViewById<TextView>(R.id.text).text = spannable

How is it possible to bypass the problem of reading amount of money on Samsung devices where Samsung TTS turned by default?
Or is engine bug ?

Hello. I’m not sure about the currency issue, But reading “1 000” as “One zero zero zero” seems to be working as intended by the speech engine. If you want to have this be read as “One thousand” you could try trimming the spaces programmatically from between the digits when reading using TTS.

1 Like

Similar problem, but this time only for the Swedish language TTS: Amounts such as 48283 are pronounced “fourty-thousand eight-thousand…” instead of “fourty-eight-thousand…” (actually, the words are a little bit different in Swedish, but in principle this is what happens).

I upgraded the text-to-speech engine, but no difference. When I switch to a Google TTS however, the problem is gone.

(Using a Galaxy S23, Android 13, OneUI v5.1)

Welcome to the developers forum.

Did you try trimming the spaces programmatically from between the digits when reading using TTS. This has worked in the past. How are you currently doing it with your program?

Thanks for the prompt reaction! I am aware there are often problems when there are spaces between digits. However, this is not the case this time. There are no spaces to trim.

Also, I do not get the same problem when I set my screen reader to French and read the same number. So it seems to be a bug specifically in the Swedish language resources in the Samsung TTS engine. It is not only in my own app, but a recurring problem for large number pronunciation in Swedish with this TTS.