Coder Social home page Coder Social logo

voice-enabled-timer's Introduction

Voice-Enabled Timer

Improved by Zack Freedman of Voidstar Lab

This is Google's Timer sample from the GDK, enhanced with an intuitive natural-language voice prompt.

Just say "OK Glass, set a timer" and tell it how many hours, minutes, and seconds to count. The timer will start immediately.

If you also have the official Timer Glassware installed, you can say "OK Glass, set a timer with voice" to use this app, and "OK Glass, set a timer with Timer" to use Google's version. It's not a bad idea to have both, since Google requires an Internet connection to use voice.

These will all work correctly:

  • "2 hours, 20 minutes, 30 seconds"
  • "One hour fifteen minutes"
  • "A minute"
  • "Half an hour"
  • "2 and a half hours"

If you add "paused" to your command, the timer will wait for you to start it manually. This is useful if you want to set up a timer in advance. For example:

  • "Fifteen minutes paused"

If you add "quietly" to your command, the timer will run in the background. This is useful if you want to run more hands-free commands. When opened quietly, the timer starts sooner. For example:

  • "Two and a half minutes quietly"

Most extra words are just ignored, so talk naturally. For example, all of these commands work:

  • "One hour and 45 minutes"
  • "30 seconds start paused and quietly"
  • "15 minutes please"
  • "Three hours thirty minutes 45 seconds and a partridge in a pear tree"

If the app can't interpret your command, the card opens with a blank timer so you can configure it by hand.

Once it's set and launched, the timer behaves exactly like Google's version. Tap its card for the menu, which allows you to set, start, pause, resume, reset, change, and stop the timer.

Running the sample on Glass

You can use your IDE to compile and install the sample or use adb on the command line:

$ adb install -r VoiceEnabledTimer.apk

To start the sample, say "OK Glass, set a timer for..." from the Glass clock screen or use the touch menu, then tell it how long.

More Information

Voice-Enabled Timer was modified from Google's platform sample by Zack Freedman of Voidstar Lab. Visit his site for more custom Glassware, first-person video blogging, and more.

Changelog:

12/11/13: - Now parses "X and a half Y" phrases - Timer now starts running automatically: - Removed power word 'starting now' - Added power word 'paused' - Implemented power word 'quietly' to run in background - Properly parses a couple of corner cases like "1&a" - Removed parsing for unnecessary words like "starting" - Added more Logcat debug strings for parsing

4/16/14:

  • Updated for XE16, which actually exists, much to my surprise
  • Now ignores leading 'for'
  • Uses listed "Start a Timer" voice command
  • Uses Glass' requirements to prevent from launching without Internet or mic available

voice-enabled-timer's People

Contributors

alainv avatar zackfreedman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.