Author Topic: Text-to-speech Help  (Read 2269 times)

Pratham26

  • Guest
Text-to-speech Help
« on: December 20, 2017, 08:33:34 AM »
Hi, I would like to ask if there is an option in Text-to-speech that makes it repeat a random number that the user has said in that command. For example, if I say the command "five six seven eight, set", then voice attack recognises the number I said before "set", and Text-to-speech replies with "five six seven eight, etc"???

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Text-to-speech Help
« Reply #1 on: December 20, 2017, 02:13:39 PM »
You have two main option here: Either define the numbers you can speak beforehand for regular, more reliable recognition, or use dictation to be able to speak anything, but with much lower accuracy. Both of these have issues.


For the first option, there's the issue of "command phrase collisions", that is to say that VoiceAttack can't extrapolate a command phrase with consecutive repeated segments. E.G. "[1..9] [1..9;] [1..9;] [1..9;] set" would generate multiple versions of "1 set", and a command phrase must be unique.

The Microsoft Speech Recognition engine does allow you to speak multi-digit numbers as single digits(E.G. "one two three" for 123), but that's an issue for TTS as it would speak the number as tens, hundreds, or thousands.

To get around this, you can use the "{TXTSUBSTR:}" token to retrieve individual digits:
[1..9999] set number
Code: [Select]
Say, '{TXTSUBSTR:"{CMD}": 0: 1} {TXTNUM:"{TXTSUBSTR:"{CMD}": 1: 1}"} {TXTNUM:"{TXTSUBSTR:"{CMD}": 2: 1}"} {TXTNUM:"{TXTSUBSTR:"{CMD}": 3: 1}"}'
I'm also using the "{TXTNUM:}" token to filter out anything that isn't a number, in case you speak fewer than four digits.

However, one major disadvantage of using this method is the amount of command phrase variations generated; If you need four digits you'll generate 9999 command phrases, which means editing the command and/or loading the profile takes a while, as VoiceAttack has to generate all the possible phrases(and your profile is likely to contain more than one command, on top of that).

In addition, I couldn't get the speech recognition engine to recognize the command with that amount of digits(it actually stopped working entirely).


Dictation on the other hand, doesn't generate many command phrases, but is likely to have trouble recognizing the number accurately and without erroneous words tacked on, if it recognizes the command at all.

*set number
Code: [Select]
Say, '{TXTSUBSTR:"{CMD_BEFORE}": 0: 1} {TXTNUM:"{TXTSUBSTR:"{CMD_BEFORE}": 1: 1}"} {TXTNUM:"{TXTSUBSTR:"{CMD_BEFORE}": 2: 1}"} {TXTNUM:"{TXTSUBSTR:"{CMD_BEFORE}": 3: 1}"}'