Finished Speaking?

Hi,

I’m using shell.Execute to have my app speak some text. Is there a way to know when the system (Mac OS) is finished speaking all the text?

Thanks.

What shell command are you using? Is there a reason you aren’t using Xojo’s System.Speak? Why do you want to know when it is finished?

I’m using s.Execute("say -v Samantha " + chr(34) + text + chr(34))

There are a bit more options using shell than XOJO’s System.Speak.

I just have some ides for things when its finished.

In this case, it looks like you can use the -i option to interactively display the text as it is spoken. You could track this against the input string by making the shell interactive, I think. There’s also a progress meter option --progress you could potentially similarly observe. Synchronously it returns when complete, according to the docs. See man say

I see. I’ll looking into that.

Thanks.

If you would use NSSpeechSynthesizerMBS class in MBS Xojo Plugins, you could get events to notify you when speech is finished or a word is about to start.

For Windows, you could use WinSpeechMBS class, which has an IsSpeaking property to check that regularly.

I did get my app to do what I wanted, but thanks anyway!

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.