Android Question Text to Speech and timing

tsteward

Well-Known Member
Licensed User
Longtime User
My app helps people program remotes into their vehicles. The procedures are often time critical and complicated. By following verbal prompts rather than reading and trying to remember instructions I hope to make this process easier.

My question is how can I extend the pause at the end of a sentence. Is there a character or method I can use. As reading a block of text non stop is bad form and may result in going through the process too quickly.

Example text.
Ensure the drivers dooris open and all other doors are closed.
Insert key into ignition.
remove key from ignition.
Insert key into ignition.
remove key from ignition.
Close drivers door.
Open drivers door.
Close drivers door.
Open drivers door.
Insert key into ignition.
remove key from ignition.
Close drivers door.
Open drivers door.
Close drivers door.
Open drivers door.
Insert key into ignition.
Close drivers door.
Turn key from Off to On.
Turn key back to Off and remove.

The door locks should now cycle.

Simultaneously press both Lock and Unlock buttons on the remote and hold for 1 second.
Now press the Lock button

The door locks should now cycle once if successful.

Open the drivers door to terminate programming.
 

Branko Milosevic

Active Member
Licensed User
B4X:
Sub TTS_Ready (Success As Boolean)
   tts.Speak("this is the first sentence", False)
   PlaySilence(3000)
   tts.Speak("this is the second sentence", False)
  
End Sub

Sub PlaySilence(DurationMs As Long)
   Dim jo As JavaObject = tts
   jo.RunMethod("playSilence", Array(DurationMs, 1, Null))
End Sub
It's an old thread but could be still apropriate to post here. Speak and PlaySilence methods were depreciated in API 21 and replaced by Speak and PlaySilentUtterance
B4X:
playSilentUtterance(long durationInMs, int queueMode, String utteranceId)
How is this addressed in the Library and should the PlaySilence sub be as below for the > API21 level and perhaps perform a check and call one or the other?

B4X:
Sub PlaySilence(DurationMs As Long)
   Dim jo As JavaObject = tts
   jo.RunMethod("playSilentUtterance", Array(DurationMs, 1, Null))
End Sub

Thanks,
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
It's an old thread but could be still apropriate to post here
No. You should create a new thread for each new question. You can refer to this thread if you want.
 
Upvote 0
Top