2

I am setting the content description for a TextView using setContentDescription method.

The string passed to this method is a concatenation of two sentences separated by a period "."

When TalkBack ot TTS (Text-To-Speech) read this, it does not mark a pause between the two sentences.

My question is, is there a some way to handle this, a special UTF character for example ?

MMasmoudi
  • 508
  • 1
  • 5
  • 19

2 Answers2

4

Try a newline charachter.

To read this barcode: "3S REGR 2345", I found that "3 S\nR E G R\n2 3 4 5" got me the result I was after on Samsung TTS.

It will be read as "Three S. R E G R. Two Three Four Five"

Nino van Hooff
  • 3,677
  • 1
  • 36
  • 52
  • Nice solution! I was using a comma separator but it caused some strange pronunciation issues. New line character seems to work well. Thanks! – dev2505 Feb 10 '21 at 21:17
  • this solution works with jetpack compose as well. good one! – Manu Jun 13 '23 at 19:06
1

Uncertain if there is any special character available, but another solution might be to split the speech and add

textToSpeech.playSilence(750, TextToSpeech.QUEUE_ADD, null);

then continue with the rest of the split

AdrianBeukes
  • 23
  • 1
  • 9
  • 1
    For more information you can also take a look at the following questions answer [https://stackoverflow.com/questions/4970204/how-to-pause-android-speech-tts-texttospeech] – AdrianBeukes Jul 12 '18 at 09:44
  • Thanks Yes, this should work for TTS. But I wanted a solution that works for both TTS and TalkBack (that's why I asked if there is a special character that is understood by both of these voice tools) – MMasmoudi Jul 12 '18 at 10:06