Announcement

Collapse
No announcement yet.

Voice Reconition

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

    Voice Reconition

    hey guys it been a while since i've been on, i ended up moving back to my home state boy am i glad to be back!! Any ways i'm trying to make a script that would ask "are you shure you wish to delete this??" and wait for a voice response this is what i have so far.. thank guys.

    Script ******
    Sub Main
    hs.lastvoicecommand = ""
    hs.AddVoiceCommand("yes")
    hs.AddVoiceCommand("no")

    if hs.lastvoicecommand = "yes" then
    hs.speak "all done"
    end if

    if hs.lastvoicecommand = "no" then
    hs.speak "cancelled"
    end if


    End Sub
    Script ******

    #2
    It's been a while since I've been on too...

    You're missing the part where you loop while waiting for the answer to be spoken. Like so :

    PHP Code:
            hs.LastVoiceCommand=""

            
    hs.AddVoiceCommand "yes"
            
    hs.AddVoiceCommand "no"

            
    hs.StartListen

            
    Do
                 
    answer hs.LastVoiceCommand
                 
    If answer "yes" Then
                      
    do SOMETHING
                      
    Exit Do
                 ElseIf 
    answer "no" then
                      
    do SOMETHING ELSE
                      Exit Do
                 
    End if
                 
    hs.WaitEvents
            Loop 
    Just so happens, I'm revisiting VR too and this type of script used to work but no longer works for me. If I look at my speaker client when the script runs, I notice that it switches on its own to either "not listening" or "listening for attention", which makes it ignore spoken commands added with "AddVoiceCommand". It also rebuilds the VR commands on the fly which doesn't help as far as I can see.

    I've had some success forcing it to listen for commands by putting the hs.ListenforCommands in the loop, but it's very awkward as it always wants to revert to not listening or listening for attention immediately.

    If someone has a fix for this, I'm interested too...

    (note that the sample script hangs when run, as it fails to recognize the answer being spoken. I have to shut it off manually after it exceeds the running time limit...)

    p.s. I found this post, which probably nails it... : http://board.homeseer.com/showthread...ddvoicecommand
    Last edited by fran_joel; December 23, 2014, 09:13 PM.

    Comment


      #3
      Yeah, and check out the date. I have been trying to get Rich to fix the VR event trigger to no avail.
      Don

      Comment


        #4
        Bummer...

        Comment

        Working...
        X