SAPI5 for modern PB.

Just starting out? Need help? Post your questions and find answers here.
Ty1003
User
User
Posts: 31
Joined: Thu May 14, 2020 10:31 pm

SAPI5 for modern PB.

Post 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! :)
Cyllceaux
Enthusiast
Enthusiast
Posts: 510
Joined: Mon Jun 23, 2014 1:18 pm

Re: SAPI5 for modern PB.

Post 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
ebs
Enthusiast
Enthusiast
Posts: 557
Joined: Fri Apr 25, 2003 11:08 pm

Re: SAPI5 for modern PB.

Post 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.
Ty1003
User
User
Posts: 31
Joined: Thu May 14, 2020 10:31 pm

Re: SAPI5 for modern PB.

Post by Ty1003 »

Thank you everyone for the suggestions. I will look at these! :)
Post Reply