[GUIDE][Difficulty: Intermediate] Poor man's Chromecast Audio with voice control

Search This thread

supermooshman

Senior Member
Apr 3, 2009
115
8
My first guide so if not everything is clear, let me know :eek:
My tablet screen broke a few days ago (a bottle of tequila fell on it) but the device itself works just hunky dory. Together with the fact that I really want to get a Chromecast Audio (but I am too cheap and I'm guessing that the two current versions will be merged into one as a Chromecast 3): enter the Poor Man's Chromecast Audio.


What it does: voice activate music on a remote device through Google Now
Example: (speaking to my phone) OK Google - Nexus play Artic Monkeys
- the tablet starts playing Artic Monkeys
Example: (speaking to my phone) OK Google - Nexus play the wolves
- the tablet starts playing the wolves (by Ben Howard)

Prerequisites
  • Tasker (duh)
  • Google Play Music (should work with other media players as well - given some minor adjustments, check out the end of this post)
  • Pushbullet
  • Autovoice - paid Tasker plugin, there is a lite version but the price definitely worth it (also the dev is a really helpful guy)
  • Autoshare - same as above
  • Extra Android device (mine is a tablet which didn't accept any touch screen input, so I needed an USB mouse + keyboard as well)

Instructions
I'll be using remote (where you insert the command - in my case the phone) and player (which plays the music - in my case the tablet)

  1. Remote
  2. profile - AutoVoice Recognized"
    Code:
    Command: "nexus (?<tabletaction>.+) (regex)"
  3. task - 1 Push a Notification with the message "%tabletaction"

    Player
  4. Received a push: If I received a note containing the text "play" from anyone (my girlfriend uses it as well, if only you use it, ofc change this)
  5. Variable Set: %pushbullet to %CLIP
  6. Say: OK, I'll %pushbullet
  7. Test Variable: Type: length Data: %pushbullet Store result in: %length
  8. Variable Set: Name %cutoff to %length-5
  9. Variable Section: Name $pushbullet from 6 Length %cutoff
  10. Autoshare
    Code:
    Package: com.google.android.music
    Class: com.google.android.music.VoiceActionsActivity
    App: Google Play Music
    Action: Search and play
    Query: %pushbullet

Using this as a template it's possible to add other commands (example: change #4 to react to "note containing stop" and #10 to "Media Control cmd Stop"), seeing how it is mostly the same thing over and over, I won't put all the ones I have here (unless someone asks for them).
Things which I have added:
  • volume control
  • media control (stop, skip to next)
  • turn tablet off

Even though I am sure you can use this with other applications (and not just audio), I currently don't use anything except for Google Play Music but check out http://joaoapps.com/autoshare/intents/ for more possibilities
 
Last edited: