Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Checking if speech finished? (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Wrong Canvas.MouseUp Event?
Next thread: Error loop prevention?


Encodings, Trademarks, Files, and POSIX   -   Rubber Chicken Software Co.
  Checking if speech finished?   -   Andy Dent
   Re: Checking if speech finished?   -   Joe Strout
   Re: Checking if speech finished?   -   Charles Yeomans
   Re: Checking if speech finished?   -   Christian Schmitz
    Re: Checking if speech finished?   -   Wade Maxfield
     Re: Checking if speech finished?   -   Andy Dent
   Re: Encodings, Trademarks, Files, and POSIX   -   Tim Jones

Checking if speech finished?
Date: 30.04.09 10:17 (Thu, 30 Apr 2009 17:17:37 +0800)
From: Andy Dent
If you use the Speak command, which does asynch speech on Mac and
Windows, is there any way to tell that it has finished?

One of the options in rbKarel http://code.google.com/p/rbstuff/wiki/rbKarelOverview
is to speak every action as it occurs.

This implies we would like the robot to not proceed until the previous
action is completed, so I'd like some way to poll the speaking status
or otherwise block on speech completion.

As this is an open source project, it can't rely on any proprietary
plugins for this option.

thanks

Andy Dent
Freelance Designer-Developer - C++, C#, Objective-C, Python, REALbasic

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Checking if speech finished?
Date: 30.04.09 15:29 (Thu, 30 Apr 2009 08:29:20 -0600)
From: Joe Strout
Andy Dent wrote:

> If you use the Speak command, which does asynch speech on Mac and
> Windows, is there any way to tell that it has finished?

Only with declares. (And no, I don't have any handy -- in the past I've
done some speech stuff with declares on the Mac, but it turned out to be
hairier than it looked. Just checking whether the computer is speaking
might be easier though.)

Best,
- Joe

Re: Checking if speech finished?
Date: 30.04.09 16:04 (Thu, 30 Apr 2009 11:04:49 -0400)
From: Charles Yeomans

On Apr 30, 2009, at 5:17 AM, Andy Dent wrote:

> If you use the Speak command, which does asynch speech on Mac and
> Windows, is there any way to tell that it has finished?
>
> One of the options in rbKarel http://code.google.com/p/rbstuff/wiki/rbKarelOverview
> is to speak every action as it occurs.
>
> This implies we would like the robot to not proceed until the
> previous action is completed, so I'd like some way to poll the
> speaking status or otherwise block on speech completion.
>
> As this is an open source project, it can't rely on any proprietary
> plugins for this option.
>

For Mac OS, you can do this using Speech Synthesis Manager functions
or NSSpeechSynthesizer, with some work. The Carbon functions all
appear to execute asynchronously; I don't know about the Cocoa stuff.

Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Checking if speech finished?
Date: 30.04.09 16:30 (Thu, 30 Apr 2009 17:30:21 +0200)
From: Christian Schmitz
Andy Dent <<email address removed>> wrote:

> If you use the Speak command, which does asynch speech on Mac and Windows,
> is there any way to tell that it has finished?

The MBS plugins have classes for Mac and Windows and you may want to
check them. (or write your own functions using declares)

Greetings
Christian

Re: Checking if speech finished?
Date: 30.04.09 20:19 (Thu, 30 Apr 2009 14:19:22 -0500)
From: Wade Maxfield
From: Joe Strout <<email address removed>>

Andy Dent wrote:

> If you use the Speak command, which does asynch speech on Mac and
> Windows, is there any way to tell that it has finished?

Only with declares. (And no, I don't have any handy -- in the past I've
done some speech stuff with declares on the Mac, but it turned out to be
hairier than it looked. Just checking whether the computer is speaking
might be easier though.)

function IsSpeaking() as boolean
#if TargetMacOS
soft Declare Function SpeechBusy Lib "Carbon" () as Short

dim r As short

try
r = SpeechBusy()

if r > 0 Then
Return True
end if
return False
Catch
Return False
end try

#endif
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Checking if speech finished?
Date: 01.05.09 01:03 (Fri, 1 May 2009 08:03:47 +0800)
From: Andy Dent

On 05/01/2009, at 3:19 AM, Wade Maxfield wrote:
>
> function IsSpeaking() as boolean
> #if TargetMacOS

Thanks Wade, you're a star!

It worked very nicely:

Sub SpeakSynchronously(msg as string)
// tries to wait politely until speech is completed
Speak msg
while IsSpeaking
app.SleepCurrentThread 50
wend
End Sub

As the initial class using rbKarrel are Mac-based, this will make them
very happy.

I have put it up in the rbstuff project:

http://code.google.com/p/rbstuff/source/browse/trunk/Common/SpeechUtilties.xml

regards

Andy Dent
Freelance Designer-Developer - C++, C#, Objective-C, Python, REALbasic

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>