Speech input / voice controll

Post your questions and help other users.

Moderator: Martin

Guid
Posts: 7
Joined: 16 Jun 2016 19:43

Speech input / voice controll

Post by Guid » 17 Jun 2016 06:35

Hi, I would please need some help to create a flow to controll my smartphone via speech input.

I want that the phone does this or that depends on what comand I speek.

E.g. I say "open contacts" and the contacts are opened, or I say "open favorites" and the favorites of my browser are opened.

So I want to determin what happens in case I say this or that.

I was thinking about to trigger the flow with a shortcut. Then I speek the command and depends on what I say different things are happening on my phone.

Would really appriciate some example flows.

Many thanks!

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Speech input / voice controll

Post by Martin » 17 Jun 2016 19:43

Hi,

You could achieve this with a flow like this:
-trigger Shortcut
-action Input Speech
-condition Expression: value=="open favorites" --> true: action1
--> false: -condition Expression: value=="open contacts" --> true: action2
--> false: -condition Expression: value=="open xyz" --> true: action3
--> false: action Notification on Screen: command not recognized

The expressions to check the command could also use a function like matches with a regular expression.

You could also execute sub-flows for each command:
-trigger Shortcut
-action Input Speech
-action Execute Flows: VoiceCommandFlow {value}

When the command is open contacts, a flow with name VoiceCommandFlow open contacts would be executed.

Regards,
Martin

Guid
Posts: 7
Joined: 16 Jun 2016 19:43

Re: Speech input / voice controll

Post by Guid » 18 Jun 2016 20:08

Thanks a lot Martin, i ll try that and come back to you soon

guido

Guid
Posts: 7
Joined: 16 Jun 2016 19:43

Re: Speech input / voice controll

Post by Guid » 19 Jun 2016 05:48

Hi Martin, two questions please:

How does the phone know what to do (where is that defined)? I mean e.g. when I say "open favorites. Is that using googles speech recognition? Can I define what happens on the phone when I say "open favorites"?

Could you explain a little further what you mean with:
"
You could also execute sub-flows for each command:
-trigger Shortcut
-action Input Speech
-action Execute Flows: VoiceCommandFlow {value}
"
Are these sub-flows part of the flow you mentioned above?

Many thanks and kind regsrds
guido

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Speech input / voice controll

Post by Martin » 19 Jun 2016 18:31

Hi,

Automagic just executes the actions you defined, so you have to create an action that does what you want, for example you could use action 'Launch App' to launch an app or 'Send SMS' etc.

The sub-flows are regular flows defined on the flow list. Only special thing about such flows is that they don't require a trigger since the flows will be executed using the action 'Execute Flows'. The flows have to be enabled, even when no trigger is set.

Regards,
Martin

Guid
Posts: 7
Joined: 16 Jun 2016 19:43

Re: Speech input / voice controll

Post by Guid » 21 Jun 2016 05:41

Thanks a lot, I think I got it know.

Kr
guido

Guid
Posts: 7
Joined: 16 Jun 2016 19:43

Re: Speech input / voice controll

Post by Guid » 22 Jun 2016 06:44

Hi Martin, one more question please.
My current problem is not with creating the flow but with the speech recognizion. Altough it nearly records everything correctly when I speak it in german or english when I e.g. dictate a sms, it understads nearly nothing for automagic. Would you have any hint on why the value (word) put into the expression is not understood? Words that work are e.g. "test" or "one" also e.g. "inter" works but "internet" does not (although spoken plenty of times in different ways).

Kr
guido

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Speech input / voice controll

Post by Martin » 22 Jun 2016 19:13

The speech recognition itself is part of the system so there's nothing Automagic can do to improve the recognition quality.
Maybe the detected word is formatted slightly different, for example in upper case or lower case or contains a dash or some kind of punctuation. You can add a condition Debug Dialog to the flow directly after the voice recognition to see what the speech recognition really detected.
You can make the expression more tolerant by using toLowerCase and trim function to remove whitespace, something like this could work:
toLowerCase(trim(value))=="command"

Regards,
Martin

Guid
Posts: 7
Joined: 16 Jun 2016 19:43

Re: Speech input / voice controll

Post by Guid » 23 Jun 2016 15:09

Thanks a lot Martin. I ll try that.

Kr
Guido

Guid
Posts: 7
Joined: 16 Jun 2016 19:43

Re: Speech input / voice controll

Post by Guid » 28 Jun 2016 17:03

Hi Martin, that worked out just fine. One last question:
How do I open the keyboard? Lets say I m in the internet on the google page and instead of clicking on the google search box to open the keyboard Automagic should open it. I tried with "Steuere UI: click..." but it doesn t do anything. When I use "Steuere UI: focus..." it put the curser into the search box but does not open the keyboard. Also when I open "input speech" after the "Steuere UI: focus..." it does not write what I say into the search box.

Many thanks
guido

Post Reply