News:

HOT TIP! Enable the History Window in the main UI when trying to problem solve. It provides a handy log of what is happening. Roll over lines in the History to get more details.

Main Menu

TTS Phrase Completion Event

Started by John Smith, December 09, 2021, 10:37:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

John Smith

Здравствуйте. При использовании TTS мне нужна следующая последовательность действий:
— нажать клавишу
— запустить TTS.Speak
— после окончания работы TTS отпустить клавишу

Сейчас отпускание клавиши я делаю по таймеру, что приводит к паузам, потому что фразы разной длины. Есть ли возможность, после окончания фразы в TTS генерировать событие, по которому можно выполнить какое-либо действие?

Kalle

Sorry for the late response.


You have to use the "TTS.SpeakSync" action insteed of "TTS.Speak" in your command followed by "DxInput.KeyUp".
With TTS.SpeakSync, VC will wait until speaking is complete before continuing to the next action - that is all.




Kalle
***********  get excited and make things  **********

John Smith

Спасибо, но при таком подходе Voxcommando перестаёт реагировать на все мои действия до тех пор, пока TTS не завершит чтение фразы.

jitterjames

Use TTS.SpeakSync (this forces VC to wait for the speech action to finish before going to the next action) and also rename your command name so that it starts with ++ so that it will run in its own thread.  Only use this technique when you really need to.  Using it for all your commands can lead to confusion and instability.

Or if you want to use events, just look at the history window and you will see all events that are generated.  There are events automatically generated for TTS.start and TTS.stop

https://voxcommando.com/mediawiki/index.php?title=Events

Kalle

@John Smith
My suggestion was exactly according to your requirements  ;)
***********  get excited and make things  **********

John Smith

После окончания работы TTS, команда «Test» срабатывает с задержкой в две с половиной секунды. В чём может быть причина такой большой задержки?

Kalle

You can try James suggestion with my command above by renaming the command so that it starts with ++
***********  get excited and make things  **********

jitterjames

#7
Quote from: John Smith on December 19, 2021, 11:43:19 AM
После окончания работы TTS, команда «Test» срабатывает с задержкой в две с половиной секунды. В чём может быть причина такой большой задержки?

The event is fired with a slight delay intentionally.  Using the ++ method is probably preferable for what you are trying to accomplish.