AutoVoice AutoVoice API?

Discussion in 'AutoApps' started by SpeedFire, Mar 29, 2016.

  1. SpeedFire

    SpeedFire New Member

    Joined:
    Oct 24, 2015
    Messages:
    14
    Likes Received:
    0
    I want to integrate my android app with AutoVoice.
    So, baisacally, I want the following:
    1. Some rules (e.g. key words) to be set up by my native (android/java) app.
    2. AutoVoice intercepts commands and transfer them to my app
    3. I do my staff in the app.

    Is this possible? Is there any API for such integration?
     
  2. RuggedHunter

    RuggedHunter Member

    Joined:
    Mar 23, 2015
    Messages:
    33
    Likes Received:
    3
    I'm not sure this is entirely what you're looking for, but maybe it will help give you an idea. I have an app that is a voice controlled Bible. User can tap the app icon to launch a voice prompt...or if user has AutoVoice Continuous, they can setup a profile that launches the app. My app can detect if it was launched by AVC, so it uses %avcommnofilter instead of launching a voice prompt. Here's how I did it:

    User sets up this Recognized profile which writes %avcommnofilter to a file before launching my app:
    Profile: Voice Read Bible (283)
    Restore: no
    State: AutoVoice Recognized [ Configuration:Event Behaviour: true
    Command: "read bible"
    Contains All: true ]
    Enter: AutoVoice Launcher (85)
    A1: Write File [ File:AutoBibleData/avcommnofilter Text:%avcommnofilter Append:Off Add Newline:Off ]
    A2: AutoVoice Continuous [ Configuration:
    Stopping continuous voice recognition Package:com.joaomgcd.autovoice Name:AutoVoice Continuous Timeout (Seconds):0 ]
    A3: Media Volume [ Level:13 Display:Off Sound:Off ]
    A4: Perform Task [ Name:AB_Speaking Bible App Priority:%priority + 1 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
    A5: AutoVoice Continuous [ Configuration:
    Starting continuous voice recognition without headset Package:com.joaomgcd.autovoice Name:AutoVoice Continuous Timeout (Seconds):0 ]

    The app's launch task then uses a Test File action to determine if the %avcontinuous file exists. If it does, it reads the file into a variable and uses it as the input. If it does not exist, it launches the voice prompt for input. The file gets deleted after the app is finished running.

    It works seamlessly. But user has to have AutoVoice installed separately, of course, if they want to use that feature...it's not built into the app itself.

    I never released that app....but it was tested extensively with a few other users. I'm currently using it as a project in Tasker...hence the Perform Task action....you would just replace that with a Launch App action.

    Sent from my SM-G928F using Tapatalk
     
  3. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,237
    Likes Received:
    777
    So if I understand correctly all you want is for AutoVoice to send stuff to your app when it detects something in Google Now?
     
  4. SpeedFire

    SpeedFire New Member

    Joined:
    Oct 24, 2015
    Messages:
    14
    Likes Received:
    0
  5. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,237
    Likes Received:
    777
    Ok, I've added a broadcast to this version of the app: https://dl.dropboxusercontent.com/u/9787157/apk/AutoVoice.apk

    Now whenever AutoVoice gets a command you'll get a broadcast with the
    "com.joaomgcd.autovoice.ACTION_AUTOVOICE_COMMAND" action and with an extra with the
    "com.joaomgcd.autovoice.EXTRA_AUTOVOICE_COMMAND" key.

    hope this helps!
     
    RuggedHunter likes this.
  6. SpeedFire

    SpeedFire New Member

    Joined:
    Oct 24, 2015
    Messages:
    14
    Likes Received:
    0
    Thank you!
    I will try.

    The only question: should I ask my users to purchase AutoVoice only, or is it also required to purchase Tasker?
     
  7. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,237
    Likes Received:
    777
    Only AutoVoice is required. But let me know if it works because I also need to update the Google Play version :)
     
  8. SpeedFire

    SpeedFire New Member

    Joined:
    Oct 24, 2015
    Messages:
    14
    Likes Received:
    0
    Sure.
    My app is in early stage right now, so there is no hurry. But I will get back to you with the results. I hope broadcast receiver will work fine.
     
  9. SpeedFire

    SpeedFire New Member

    Joined:
    Oct 24, 2015
    Messages:
    14
    Likes Received:
    0
    Ok, I've tested it. Works flawlessly! Thanks!

    Could you please also create a Broadcast Receiver in your app which will cancel Google Search results?
    So I will get a key from AutoVoice and if it meets my criteria I will send intent back to AutoVoice to cancel Google search results.

    P.S. And if possible another Broadcast Receiver to switch off/on your toast "Received possible command: XX". I'd like to make my own toast.
     
    Last edited: Apr 1, 2016
  10. SpeedFire

    SpeedFire New Member

    Joined:
    Oct 24, 2015
    Messages:
    14
    Likes Received:
    0
    Ok, I've managed to cancel Google Search results by myself.
    The API works perfectly well.
    This thread shall be marked as Solved.
     
  11. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,237
    Likes Received:
    777
    Great :)
    BTW the version with the API is already on Google Play.

    Can you confirm that the Google Play version works? thanks!
     
  12. SpeedFire

    SpeedFire New Member

    Joined:
    Oct 24, 2015
    Messages:
    14
    Likes Received:
    0
    Yes. I confirm. Google Play version works very well! Thanks again.
     
  13. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,237
    Likes Received:
    777
    Awesome! :) Can you let me know what app is using the API by the way? :)
     
: autovoice, api

Share This Page