Author Topic: [Solved] Avoid multiple simultaneous TTS  (Read 1459 times)

Shenron

  • Newbie
  • *
  • Posts: 16
[Solved] Avoid multiple simultaneous TTS
« on: June 06, 2022, 04:23:02 AM »
Hi,

When multiple commands are triggered sometimes i have multiple TTS which overlaps each others and it's difficult to understand when more than 2 occurs at the same time.

I there a way to force Voice Attack to queue TTS audio ?
« Last Edit: June 18, 2022, 11:07:58 AM by Shenron »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Avoid multiple simultaneous TTS
« Reply #1 on: June 06, 2022, 07:35:52 AM »
Assuming you actually want the commands themselves to execute simultaneously, rather than to wait until other commands are finished (which could be done by disabling the "Allow other commands to execute while this one is running" option for those commands, and disabling the "Cancel Blocked Commands" option on the "System / Advanced" tab of the VoiceAttack options window, so that commands are automatically enqueued):

You could use a separate command for TTS playback, and place that in a command queue.

E.G. your "TTS" command could look like
Code: [Select]
Say, '{TXT:~passedText1}'  (and wait until it completes)
(This command can have its "When I say" option disabled after inputting the command name, as it's not intended to be triggered manually using speech recognition)

And in the commands that may be executed simultaneously, you'd use something like
Code: [Select]
Enqueue command, 'TTS' into [TTS] - passing values (and start queue execution immediately)
where the "Text" field in the "Passed Values (Advanced)" section contains the text you want to be spoken, wrapped in double quotes, E.G.
Code: [Select]
"This text will be enqueued"

Alternatively, if you'd prefer the text to be visible in the action list, you can use a text variable, E.G.
Code: [Select]
Set text [~textToSpeak] to 'This text will be enqueued'
Enqueue command, 'TTS' into [TTSQueue] - passing values (and start queue execution immediately)
where the "Text" field in the "Passed Values (Advanced)" then contains the variable name, I.E.
Code: [Select]
~textToSpeak(Note: No double quotes, as this is a variable name rather than a literal text value)
Do make sure that the "Evaluate passed values when command is queued" option is enabled.


If you need different settings for the "Say Something with Text-To-Speech" for different commands, you'd need to set up a separate command (or use another passed value and a set of conditions in the existing commands, to select the appropriate action) for each of those, and add it to the same queue.

Shenron

  • Newbie
  • *
  • Posts: 16
Re: Avoid multiple simultaneous TTS
« Reply #2 on: June 06, 2022, 03:16:42 PM »
Thank you Pfeil for this great answer.
I have to try this "enqueue command" feature but it's definitely a good way to go.

Shenron

  • Newbie
  • *
  • Posts: 16
Re: Avoid multiple simultaneous TTS
« Reply #3 on: June 18, 2022, 11:07:36 AM »
A little update since this is implemented for over a week now
it works great and answer perfectly my need
Thanks again Pfeil