Vocal Messaging (Former Vocal Whatsapp) 2015-06-02

Send Whatsapp or text messages via Google Now

  1. dpadula85
    This profile uses Autovoice, Autocontacts and Whatstasker plugins, thus it needs root to work.

    The profile is triggered by saying “Send a text|whatsapp message to Name_of_Contact” in Google Now or Autovoice.

    It uses Autocontacts to look for a matching contact in you contacts list.

    You are then asked for a message in a certain language (in this case ITA/ESP/ENG, since those are the languages I write in with my contacts).

    The message you spoke is finally sent through Whatstasker or as an SMS, depending on how you triggered the profile.

    The structure is pretty simple: the command triggers a main task. The main task is linked to sub-tasks that execute the operations needed to send a message with a certain client. Only one sub-task is called, depending on the initial command.
    This way it's easy to implement more possibilities in case you would like to add other sub-tasks for your favorite messaging clients.
    My wish would be to add Facebook Messenger Vocal Messaging as soon as I have some time and come up with a good idea.

    Finally, I paste here the description from Tasker. Any modification is welcome, and you are encouraged to post it, it could be something I didn't think about.

    Code (Text):

    Profile: Vocal Messaging (57)
        State: AutoVoice Recognized [ Configuration:Event Behaviour: true
    Command: "send a (?<type>text|whatsapp) message to (?<name>.+) (regex)" ]


    Enter: Vocal Msg (102)
        A1: Run Shell [ Command:svc data enable Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ] If [ %Data eq 0 & %WIFII !~ *CONNECTION* ]
        A2: If [ %avsource ~ googlenow ]
        A3: Kill App [ App:Google Use Root:On ]
        A4: End If
        A5: AutoContacts [ Configuration:Contact Name or Nickname: %name
    Name as Nickname: true Package:com.joaomgcd.autocontacts Name:AutoContacts Timeout (Seconds):1000 ]
        A6: If [ %acname ~ \%acname ]
        A7: Say [ Text:Contact not found, please repeat the contact's name. Engine:Voice:com.google.android.tts:eng-usa Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ]
        A8: AutoVoice Recognize [ Configuration:
    Language Model: Free Form
    Voice command without headset
    Command: "all" Package:com.joaomgcd.autovoice Name:AutoVoice Recognize Timeout (Seconds):120 ]
        A9: Variable Set [ Name:%name To:%avcomm Do Maths:Off Append:Off ]
        A10: Goto [ Type:Action Number Number:4 Label: ]
        A11: End If
        A12: If [ %type ~ text ]
        A13: Popup [ Title:Contact Found! Text:%acname Background Image: Layout:Popup Timeout (Seconds):3 Show Over Keyguard:On ]
        A14: Variable Split [ Name:%acallnumbertypes1 Splitter:, Delete Base:Off ]
        A15: Variable Set [ Name:%index To:%acallnumbertypes1(#?Mobile) Do Maths:Off Append:Off ]
        A16: If [ %index > 0 ]
        A17: Variable Split [ Name:%acallnumbers1 Splitter:, Delete Base:Off ]
        A18: Variable Set [ Name:%num To:%acallnumbers1(%index) Do Maths:Off Append:Off ]
        A19: Else
        A20: Variable Set [ Name:%num To:%acnumber Do Maths:Off Append:Off ]
        A21: End If
        A22: Perform Task [ Name:Vocal SMS Priority:%priority + 1 Parameter 1 (%par1):%num Parameter 2 (%par2): Return Value Variable: Stop:Off ]
        A23: Else If [ %type ~ whatsapp ]
        A24: Perform Task [ Name:Vocal Whatsapp Msg Priority:%priority + 1 Parameter 1 (%par1):%acname Parameter 2 (%par2): Return Value Variable: Stop:Off ]
        A25: End If
        A26: Run Shell [ Command:svc data disable Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ] If [ %Data eq 0 ]


    #********************
    #    SUB TASKS
    #********************

    Vocal SMS (101)
        A1: Variable Split [ Name:%par1 Splitter:+ Delete Base:Off ]
        A2: Say [ Text:Detta il messaggio. Engine:Voice:com.svox.pico:ita-ITA Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %par1(2) ~ 39* ]
        A3: Say [ Text:Cuál es tu mensaje? Engine:Voice:com.svox.pico:spa-ESP Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %par1(2) ~ 34* ]
        A4: Say [ Text:What would you like to send? Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %par1(2) !~ 39* & %par1(2) !~ 34* ]
        A5: AutoVoice Recognize [ Configuration:Language Code: it-IT
    Language Model: Free Form
    Voice command without headset
    Command: "all" Package:com.joaomgcd.autovoice Name:AutoVoice Recognize Timeout (Seconds):120 ] If [ %par1(2) ~ 39* ]
        A6: AutoVoice Recognize [ Configuration:Language Code: es-ES
    Language Model: Free Form
    Voice command without headset
    Command: "all" Package:com.joaomgcd.autovoice Name:AutoVoice Recognize Timeout (Seconds):120 ] If [ %par1(2) ~ 34* ]
        A7: AutoVoice Recognize [ Configuration:
    Language Model: Free Form
    Voice command without headset
    Command: "all" Package:com.joaomgcd.autovoice Name:AutoVoice Recognize Timeout (Seconds):120 ] If [ %par1(2) !~ 39* & %par1(2) !~ 34* ]
        A8: Variable Set [ Name:%msg To:%avcomms(1)  Do Maths:Off Append:Off ]
        A9: Say [ Text:Do you want to send this message? Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ]
        A10: Popup [ Title:Message Text:%msg Background Image: Layout:Popup Timeout (Seconds):3 Show Over Keyguard:On ]
        A11: Destroy Scene [ Name:Popup ]
        A12: Get Voice [ Title: Language Model:Free Form Maximum Results:1 Timeout (Seconds):30 ]
        A13: If [ %VOICE ~ yes | %VOICE ~ sì ]
        A14: Send SMS [ Number:%par1 Message:%msg Store In Messaging App:Off ]
        A15: Else
        A16: Goto [ Type:Action Number Number:2 Label: ]
        A17: End If

    Vocal Whatsapp Msg (47)
        A1: WhatsTasker Search Contact [ Configuration:Name: %par1
    Ignore diacritics: No
    Search: Anywhere Package:net.zhdev.whatstasker Name:WhatsTasker Search Contact Timeout (Seconds):3 ]
        A2: If [ %wt_searchresultids(#) = 0 ]
        A3: Say [ Text:Contact not found, please repeat the contact's name. Engine:Voice:com.google.android.tts:eng-usa Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ]
        A4: AutoVoice Recognize [ Configuration:
    Language Model: Free Form
    Voice command without headset
    Command: "all" Package:com.joaomgcd.autovoice Name:AutoVoice Recognize Timeout (Seconds):120 ]
        A5: Variable Set [ Name:%par1 To:%avcomm Do Maths:Off Append:Off ]
        A6: Goto [ Type:Action Number Number:1 Label: ]
        A7: Else
        A8: Popup [ Title:Contact Found! Text:%wt_searchresultnames(1) Background Image: Layout:Popup Timeout (Seconds):3 Show Over Keyguard:On ]
        A9: End If
        A10: Say [ Text:Detta il messaggio. Engine:Voice:com.svox.pico:ita-ITA Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %wt_searchresultids(1) ~ 39* ]
        A11: Say [ Text:Cuál es tu mensaje? Engine:Voice:com.svox.pico:spa-ESP Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %wt_searchresultids(1) ~ 34* ]
        A12: Say [ Text:What would you like to send? Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ] If [ %wt_searchresultids(1) !~ 39* & %wt_searchresultids(1) !~ 34* ]
        A13: AutoVoice Recognize [ Configuration:Language Code: it-IT
    Language Model: Free Form
    Voice command without headset
    Command: "all" Package:com.joaomgcd.autovoice Name:AutoVoice Recognize Timeout (Seconds):120 ] If [ %wt_searchresultids(1) ~ 39* ]
        A14: AutoVoice Recognize [ Configuration:Language Code: es-ES
    Language Model: Free Form
    Voice command without headset
    Command: "all" Package:com.joaomgcd.autovoice Name:AutoVoice Recognize Timeout (Seconds):120 ] If [ %wt_searchresultids(1) ~ 34* ]
        A15: AutoVoice Recognize [ Configuration:
    Language Model: Free Form
    Voice command without headset
    Command: "all" Package:com.joaomgcd.autovoice Name:AutoVoice Recognize Timeout (Seconds):120 ] If [ %wt_searchresultids(1) !~ 39* & %wt_searchresultids(1) !~ 34* ]
        A16: Variable Set [ Name:%msg To:%avcomms(1)  Do Maths:Off Append:Off ]
        A17: Say [ Text:Do you want to send this message? Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus:On Network:Off Continue Task Immediately:Off ]
        A18: Popup [ Title:Message Text:%msg Background Image: Layout:Popup Timeout (Seconds):3 Show Over Keyguard:On ]
        A19: Destroy Scene [ Name:Popup ]
        A20: Get Voice [ Title: Language Model:Free Form Maximum Results:1 Timeout (Seconds):30 ]
        A21: If [ %VOICE ~ yes | %VOICE ~ sì ]
        A22: WhatsTasker Send Message [ Configuration:ID: %wt_searchresultids(1)
    Message: %msg Package:net.zhdev.whatstasker Name:WhatsTasker Send Message Timeout (Seconds):3 ]
        A23: Else
        A24: Goto [ Type:Action Number Number:9 Label: ]
        A25: End If
     

Recent Updates

  1. 26 Apr 2015 Second Update - SMS extension
  2. 26 Apr 2015
  3. 20 Apr 2015