AutoInput Detect Google Assistant finished speaking

Discussion in 'AutoApps' started by aabaud, Oct 28, 2016.

  1. aabaud

    aabaud New Member

    Joined:
    Apr 27, 2016
    Messages:
    19
    Likes Received:
    0
    I am able to use UI Query to detect that GA has started speaking, but I can't figure out how to detect that it has finished. Any suggestions?
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    How exactly are you able to do that? Thanks
     
  3. aabaud

    aabaud New Member

    Joined:
    Apr 27, 2016
    Messages:
    19
    Likes Received:
    0
    Not sure it captures the exact moment speech starts, but pretty close.
    Test Speaking (473)
    A1: Voice Command
    A2: AutoInput UI Query [ Configuration:Only Visible: false

    Only Clickable: true
    App Package: com.google.android.googlequicksearchbox
    Check Screen State: false
    Text: Send feedback Timeout (Seconds):30 ]
    A3: Flash [ Text: Done Long:Off ]
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Oh I see what you mean. So that's using the regular Google App for searches, right? Not the new Google Pixel assistant?
     
  5. aabaud

    aabaud New Member

    Joined:
    Apr 27, 2016
    Messages:
    19
    Likes Received:
    0
    Well, I think Tasker's "Voice Command" action starts GA on my Pixel. It looks and acts just like the GA I get when I say "OK Google".
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    And when it responds it still does it in GA?
     
  7. aabaud

    aabaud New Member

    Joined:
    Apr 27, 2016
    Messages:
    19
    Likes Received:
    0
    Yes. I just tried the Google Assistant example "How long will it take to get to downtown chicago", and then "What restaurants are there?".
    It responded the same way in the "OK Google" interaction and the Tasker "Voice Command" action.
     
  8. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Hmm. Does the task above work the same if you don't use the UI Query action? I'm just asking because on my device AutoInput can't see Google Assistant at all. It's like it doesn't even exist.
     
  9. aabaud

    aabaud New Member

    Joined:
    Apr 27, 2016
    Messages:
    19
    Likes Received:
    0
    Yep, I commented out the AutoInput action and it works the same. Except "Done" appears immediately, instead of waiting for "Send feedback" to appear on the screen.
     
  10. aabaud

    aabaud New Member

    Joined:
    Apr 27, 2016
    Messages:
    19
    Likes Received:
    0
    I just did AutoInput's "Variable Setup" then long pressed the Pixel Home button (which starts GA), then clicked "Accept" in the AutoInput notification. That's when the App Package got populated with com.google.android.googlequicksearchbox
     
  11. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Yes, because that's the package name for the google launcher :) But when the assistant is on screen I can't get any info on it. Does your phone go to your home screen when you open google assistant?
     
  12. aabaud

    aabaud New Member

    Joined:
    Apr 27, 2016
    Messages:
    19
    Likes Received:
    0
  13. aabaud

    aabaud New Member

    Joined:
    Apr 27, 2016
    Messages:
    19
    Likes Received:
    0
    This also works with the screen off, by the way. I have a Flic Button that can trigger a Tasker task. When the screen is off and I press the button, I get get the "Ding" from GA indicating that it's listening, and I can say "what time is it", for example, and it will respond. All the time the screen stays off.

    This is great behavior, because I can use it in my car when my phone is in my pocket and use my car's Bluetooth microphone and speaker to interact with GA. Right now I wait 25 seconds before I disable headset sound, but what I'd prefer to do is replace the 25 second wait with something that would react to the fact that GA has finished speaking. Hence the original question. Here's the task.

    Code (Text):

    Google Assistant (172)
        A1: Variable Set [ Name:%Speaking To:Google Assistant Do Maths:Off Append:Off ]
        A2: AutoVoice Ctrl BT [ Configuration:Enabling Headset Sound Timeout (Seconds):0 ]
        A3: Wait [ MS:500 Seconds:0 Minutes:0 Hours:0 Days:0 ]
        A4: Voice Command
        A5: Variable Set [ Name:%endtime To:%TIMES + 25 Do Maths:On Append:Off ]
        A6: Wait Until [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ] If [ %Speaking !Set | %TIMES > %endtime ]
        A7: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
        A8: AutoVoice Ctrl BT [ Configuration:Disabling Headset Sound Timeout (Seconds):0 ]
        A9: Variable Clear [ Name:%Speaking Pattern Matching:Off ]
        A10: Flash [ Text:Done Long:Off ]
     
    The reason for the %Speaking stuff is that my Flic button actually runs this task, which either runs GA or stops it if it's already running
    Code (Text):

    Toggle Voice (207)
        A1: If [ %Speaking Set ]
        A2: Shut Up
        A3: AutoVoice Ctrl BT [ Configuration:Disabling Headset Sound Timeout (Seconds):0 ]
        A4: Stop [ With Error:Off Task:%Speaking ]
        A5: Variable Clear [ Name:%Speaking Pattern Matching:Off ]
        A6: Else
        A7: Perform Task [ Name:Google Assistant Priority:%priority - 1 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
        A8: End If
     
    Last edited by a moderator: Oct 31, 2016
  14. aabaud

    aabaud New Member

    Joined:
    Apr 27, 2016
    Messages:
    19
    Likes Received:
    0
    By the way, how do I turn off the damn smilies in this forum?
     
  15. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    You use code tags like I did for you above :)

    Sorry, but I don't really think there's a way to know when the assistant stopped replying. I wish I could help, but I think the one you have now is probably the best way to do it.
     
  16. aabaud

    aabaud New Member

    Joined:
    Apr 27, 2016
    Messages:
    19
    Likes Received:
    0
    OK. Thanks for looking into it.
     

Share This Page