Announcement

Collapse
No announcement yet.

Scripting issue: The Wait parameter in hs.Speak appears to not be working.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Scripting issue: The Wait parameter in hs.Speak appears to not be working.

    This probably isn't the place for a bug report, but there doesn't seem to be a place to report issues, so here I am.

    I'm using hs.Speak with the parameter 'Wait' in a test script and notice that in fact it doesn't. Also appearing not to work is IsSpeakerBusy.
    This is my test script
    PHP Code:
    hs.WriteLog("Starting to Speak")
    hs.Speak(str,TRUE)
    hs.Waitsecs(0.05)
    Do while 
    hs.IsSpeakerBusy("*:*")
    hs.Waitsecs(0.05)
    Loop
    hs
    .WriteLog("Finished Speaking"

    Jun-12 2:41:16 PM TTS Speak: (HOMESEEREFAULT):Hello, and Good Afternoon. There are No appointments in your Calendars. Presently The Outside Temperature is a Cool 53 degrees. Here is the latest forecast, which is 8 Minutes old. Occasional showers possible. Highs in the mid 40s and lows in the mid 20s. Today's High will be 45 degrease and the low is expected to be 26 degrease. This concludes the weather report.

    Jun-12 2:41:14 PM *- Test.vb * --> ------------------------ Stop -------------------------------------
    Jun-12 2:41:14 PM *- Test.vb * --> -------------------------------------------------------------------------
    Jun-12 2:41:14 PM *- Test.vb * --> ----Finishing Test at: 14:41:14
    Jun-12 2:41:14 PM *- Test.vb * --> enabling After Speaking
    Jun-12 2:41:14 PM *- Test.vb * --> Enabling After Speaking
    Jun-12 2:41:14 PM *- Test.vb * --> Finished Speaking
    Jun-12 2:41:14 PM *- Test.vb * --> Starting to Speak
    Jun-12 2:41:13 PM *- Test.vb * --> Disabling Before Speaking
    Jun-12 2:41:12 PM *- Test.vb * --> Disabling After Speaking
    Jun-12 2:41:12 PM*- Test.vb * --> Start. Delay is 61000
    Jun-12 2:41:12 PM *- Test.vb * -->
    Jun-12 2:41:12 PM *- Test.vb * --> ----Starting Test at: 14:41:12
    Jun-12 2:41:12 PM *- Test.vb * --> ------------------------ Start -------------------------------------
    Jun-12 2:41:12 PM *- Test.vb * --> -------------------------------------------------------------------------

    I apologize if this it not the place for this.
    Don

    #2
    The reason is that a full stop in your sentence acts as a short pause so IsSpeakerBusy will then report false.

    Just modify your script with a countdown/reset delay; something like:

    Code:
            hs.WriteLog("Test","Starting to Speak")
            hs.Speak(str,True)
            Dim Count As Integer = 50
            Do
                If hs.IsSpeakerBusy("*:*") Then Count = 50
                hs.Waitsecs(0.01)
                Count -= 1
                If Count = 0 Then Exit Do
            Loop
            hs.WriteLog("Test","Finished Speaking")
    This will cope with delays up to 1/2 second. Changing the two Count entries from 50 to 100 would increase that to 1 second.
    Jon

    Comment


      #3
      Thanks for the explanation. I'll give that a go. Appreciate it.
      Don

      Comment

      Working...
      X