Autovoice

Post your questions and help other users.

Moderator: Martin

Lucy
Posts: 225
Joined: 10 Aug 2019 11:24

Autovoice

Post by Lucy » 18 Dec 2019 10:10

Has anyone successfully used autovoice plugin on automagic? I cant get it working. Google keeps saying "cannot recognize command" when i say "ask autovoice"

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Autovoice

Post by Desmanto » 21 Dec 2019 16:22

Why you need autovoice? Automagic already has the built-in Input Speech. I never has a lot of success with Autovoice even when I am still using tasker. But in Automagic, I can utilize input speech to a show off level. Example : I can sing a song and Automagic will complete the rest for me.

If you want to use hotword , you should use hotword plugin instead. https://forum.xda-developers.com/u/task ... e-t3692422
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

coconutxyz
Posts: 38
Joined: 16 Sep 2019 12:51

Re: Autovoice

Post by coconutxyz » 22 Dec 2019 00:08

But autovoice has the ability to intercept Google Assistant searches and I think op would like to keep using Google Assistant

Ps: to op, no problem here with autovoice,. Did you enable all permission required?

Lucy
Posts: 225
Joined: 10 Aug 2019 11:24

Re: Autovoice

Post by Lucy » 22 Dec 2019 06:16

Yes darling i know that automagic has speech actions. And i utilize them. However autovoice ties in with google like coco said as well as overall integration with softwares. Dont get me wrong, i love every aspect of automagic and have never used tasker itself. But the plugins for tasker are good. I had a look at hotword and i will pass on that one for now. "Hey google" is my goto. And i also use voice access. These combined with automagic flows and hopefully autovoice will cover every little part of software and hardware to what extent android permits. I can as it is have my phone have an entire conversation with itself and respond as people would with also completing queries but i am limited with google functionality and automagic, hence the need for autovoice. Voice access fills in most of the gaps but not all.
My darlings thank you for your support.
Coco hunny, yes i have fixed all permissions, tweaked my assistant and all measures needed to utilize it. Idk, i will figure it out😘

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Autovoice

Post by Desmanto » 22 Dec 2019 10:42

@coconutxyz : we can also get the search from Gass, but I never try to intercept it. Use UI Event and control UI. viewtopic.php?f=5&t=6507&hilit=google+assistant
Now it is much easier, because now we have getTextByIdAndIndex(). So we can loop all the element index and get the last command (before the next null). Process that command using regex and parse it properly. I suspect Autovoice also use the similar method to do it. Of course, it is must easier to have some other app do it for us, instead of creating the CUI script again.



@Lucy : I never try the voice access. It seems to require extra setup first. The first time I saw autovoice voice access, I know I have done it before, so never really dig deep into it. Of course I don't expect everyone to create a full fledged speech database as mine to control a lot of command. But it is fun and can have much more possibility than passing thru Gass first.

What I see from the voice access, you still have to setup each command by your own, just like setting up Gass Routines. Where you add command and add the action. The same can be done without setting up a full database like mine. Just after the action input speech, add expression and check if the value is the specified command. If yes, then continue to the action. My database simplify it because I can group similar actions together into a branch. So even I have hundreds of custom command, I only need less than 10 branches currently.

Now to extract the command from the Gass itself, you can use the above UI event method to get the Gass recognized command. Then pass that command to Automagic flow and execute the command accordingly. But I still need to know at least one detail example of what you want to do, so that I can try whether that is possible to be done using the UI Event method.

Also, take a look at this flow : viewtopic.php?f=3&t=7403
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Lucy
Posts: 225
Joined: 10 Aug 2019 11:24

Re: Autovoice

Post by Lucy » 22 Dec 2019 13:15

Gosh that was a lot of reading. Im out of time to chat now so I'll make this straight to the point... you have convinced me to fool around with the ui feature instead 😊👍. After work I'll be back to read up some more

coconutxyz
Posts: 38
Joined: 16 Sep 2019 12:51

Re: Autovoice

Post by coconutxyz » 24 Dec 2019 12:33

Desmanto wrote:
22 Dec 2019 10:42
@coconutxyz : we can also get the search from Gass, but I never try to intercept it. Use UI Event and control UI. viewtopic.php?f=5&t=6507&hilit=google+assistant
Now it is much easier, because now we have getTextByIdAndIndex(). So we can loop all the element index and get the last command (before the next null). Process that command using regex and parse it properly. I suspect Autovoice also use the similar method to do it. Of course, it is must easier to have some other app do it for us, instead of creating the CUI script again.



@Lucy : I never try the voice access. It seems to require extra setup first. The first time I saw autovoice voice access, I know I have done it before, so never really dig deep into it. Of course I don't expect everyone to create a full fledged speech database as mine to control a lot of command. But it is fun and can have much more possibility than passing thru Gass first.

What I see from the voice access, you still have to setup each command by your own, just like setting up Gass Routines. Where you add command and add the action. The same can be done without setting up a full database like mine. Just after the action input speech, add expression and check if the value is the specified command. If yes, then continue to the action. My database simplify it because I can group similar actions together into a branch. So even I have hundreds of custom command, I only need less than 10 branches currently.

Now to extract the command from the Gass itself, you can use the above UI event method to get the Gass recognized command. Then pass that command to Automagic flow and execute the command accordingly. But I still need to know at least one detail example of what you want to do, so that I can try whether that is possible to be done using the UI Event method.

Also, take a look at this flow : viewtopic.php?f=3&t=7403
@Desmanto i stumbled upon your hotword plugin request and am really glad that i found it lol. Due to the fact that my phone does not support screen off ok google, it is really help plus it only added like 0.5% drain per hour. So far i am using it as follow ---> trigger hotword ---> input speech ---> expression value = "xyz" ---> action but the problem is if it doesnt hear any words it will then get stuck at "try again" and there is no way i could remove it other than touching the screen. Also i would like to see how you setup your database

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Autovoice

Post by Desmanto » 24 Dec 2019 18:12

@coconutxyz : I protect the input speech with 3 level expression.
1. 1st expression check for null value. If null, then loop back to the input speech
2. 2nd expression, if the recognized value is not null, then it checks on the list of the command of the designated language. In my flow, I use regex method. So if it matches one of the regex, it stop, return true and give the output. If can't match the regex, then return false, go to the next check
3. 3rd expression checks if the miss has been 3 times or more. If miss is 0-2 times, loop back to input speech. If missed 3 times already, then still give output, but tell that it can't recognized anything.
Speecher Cropped.png
Speecher Cropped.png (138.41 KiB) Viewed 16740 times
I haven't continued my flow yet, but soon will need to. Since I need to link my yeelight and tasmota flow to it. Have just burned my only nodemcu v3 lolin (withou knowing it). Seems I have to stopped looking at tasmota until I order new ones.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

coconutxyz
Posts: 38
Joined: 16 Sep 2019 12:51

Re: Autovoice

Post by coconutxyz » 25 Dec 2019 01:04

Oh I'm interested in the 2nd and 3rd level. Currently I'm only using the execution count condition lol..

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Autovoice

Post by Desmanto » 25 Dec 2019 13:52

Sorry, the first expression should operation "ok", not null

Code: Select all

recog = toLowerCase(value);
operation == "ok"
This is to for to catch if the input speech timeout (usually about 20-25 seconds).

The 2nd expression is longer. I cut out the essential one. Since other lines are for my specific language, logging and variable replacement. I use regex method, so i can match some loosely matched value. Example, the command "Switch language to Indonesian", sometimes it is recognized as "Indonesia" without the 'n'. Using regex solve the problem, since it will match both.

Code: Select all

//loop find the recog for pattern
for(i in getMapKeys(db))
{
  j = findAll(recog, i, true);
  
  if(!isEmpty(j))
  {
    match = j[0]; //match = all, %1, %2
    break;
  }
}

match != null
If regex match found, then continue to the true branch and reply. If not, go to 3rd expression

3rd expression is to count the miss. I have set the {miss} to 0 in previous script before starting input speech.

Code: Select all

if(miss >= 3)
{
  miss = 0;
  command = "Say";
  reply = getRandomElement(dbm[lang]);
  return true;
}
else
{
  miss = miss + 1;
  return false;
}
This will check the miss, up to 3 times. If miss = 3, then reply with random "miss response", example "Sorry, I don't understand you" (it is saved in the {dbm} map. If miss < 3, then loop back to input speech.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply