Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Text-to-Speech / Wait until finished

If you have a question or need help, this is the place to be.
Post Reply
jlutsky
Posts: 16
Joined: Sun Mar 08, 2015 10:43 am

Text-to-Speech / Wait until finished

Post by jlutsky »

Is there any way to get EG to wait until text is finished speaking when using the TTS action, before moving onto the next action?
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Text-to-Speech / Wait until finished

Post by Pako »

jlutsky wrote:Is there any way to get EG to wait until text is finished speaking when using the TTS action, before moving onto the next action?
I know of no simple ways to achieve this.
However, one workaround I have for you:
1) Use a plugin IntelliSpeech instead of Speech plugin
2) Divide your macro into two parts.
3) When speaking finishes, an event IntelliSpeech.SpeakingFinished is triggered
4) The second macro run using the above event

Pako
jlutsky
Posts: 16
Joined: Sun Mar 08, 2015 10:43 am

Re: Text-to-Speech / Wait until finished

Post by jlutsky »

Pako wrote:
jlutsky wrote:Is there any way to get EG to wait until text is finished speaking when using the TTS action, before moving onto the next action?
I know of no simple ways to achieve this.
However, one workaround I have for you:
1) Use a plugin IntelliSpeech instead of Speech plugin
2) Divide your macro into two parts.
3) When speaking finishes, an event IntelliSpeech.SpeakingFinished is triggered
4) The second macro run using the above event

Pako
Thanks! This plugin does exactly what I needed.

Unfortunately, I prefer the custom voice dialects I already have installed that the basic text-to-speech plugin is able to use. But I was able to figure out an almost perfect work-around. If I have my first action be IntelliSpeech: Speak text with the volume at 1, followed immediately by the Speech: Speak action of the default plugin, both fire off some spoken text that take almost the same amount of time to finish, so I can still use the SpeakingFinished trigger to move on after that.

However, even at volume 1 I can still hear very faint speech from IntelliSpeech. Is it possible to set volume to 0, or mute the audio from IntelliSpeech entirely?
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Text-to-Speech / Wait until finished

Post by Pako »

jlutsky wrote:But I was able to figure out an almost perfect work-around. If I have my first action be IntelliSpeech: Speak text with the volume at 1, followed immediately by the Speech: Speak action of the default plugin, both fire off some spoken text that take almost the same amount of time to finish, so I can still use the SpeakingFinished trigger to move on after that.
I think it is not a good idea. It will never be reliable.
A better solution is when Speech plugin will have the same function.
You can try it out. Adjusted plugin can be downloaded from the SVN repository.

Pako
wawa79
Posts: 25
Joined: Fri Nov 02, 2012 11:01 pm

Re: Text-to-Speech / Wait until finished

Post by wawa79 »

Hello Pako,

I tried to implement an additional action to speak after interrupting any on-going speech in the 'Speech' plugin. This will help to handle priorities in notifications.

It would have been better to keep the same action and just add an 'Interrupt' parameter with a tick option but designing UI in Python is still a pain for me (even for a tick box).

I have looked a the code of the 'Speech' plugin and made few changes. They are commented with the '#ADDED: ' tag.
But because I am not familiar neither with Python nor with SAPI, my implentation might not be totally smart...
Is the thread closing correctly with my tts.Pause() action?
Why my new action 'TextToSpeechInterrupt' is not displying with the correct label in the Eg treeview of actions?

Your feedback is appreciated :oops:
Attachments
__init__.py
(16.31 KiB) Downloaded 116 times
Post Reply