Page 1 of 1

SAPI5 for modern PB.

Posted: Thu Oct 22, 2020 3:06 am
by Ty1003
Hi.
I have been trying to get SAPI5 to work in modern PB. However, I have run into issues each time.
PureTTS simply doesn't load with more modern PB.
And PBEx_Speech does not allow for stopping the speech in the middle of speaking.
I was wondering if anyone has any other solutions? Because of the nature of this project, I need to be able to stop the speech if it's currently speaking.
Thank you! :)

Re: SAPI5 for modern PB.

Posted: Thu Oct 22, 2020 7:37 am
by Cyllceaux
This workes fine,

it can pause and stop the speak.
viewtopic.php?f=13&t=71452i

but you have to change line 517 to 521. like it says in the comment

Re: SAPI5 for modern PB.

Posted: Thu Oct 22, 2020 3:23 pm
by ebs
I use Dobro's library (source here: viewtopic.php?f=12&t=51028).

It lets you enumerate the available voices and has a simple Speak() procedure.
As written, it doesn't let you interrupt speech, as Speak() doesn't return until the speech is done.
However, if you change this line

Code: Select all

VoiceObject\Speak(*mem,0,0)
to

Code: Select all

VoiceObject\Speak(*mem,1,0)
you can interrupt speech with

Code: Select all

VoiceObject\Pause()
whenever you need to.

Re: SAPI5 for modern PB.

Posted: Thu Oct 22, 2020 4:37 pm
by Ty1003
Thank you everyone for the suggestions. I will look at these! :)