GVoice-0.0.1 released



I downloaded a copy of ViaVoice yesterday and was sufficiently impressed
with its capabilities to actually read the API docs.  It seemed easy
enough to use that I tried it, and it was.  Today's hacking yielded about
500 lines of code sufficient to add voice control to an arbitrary
Gtk/GNOME application.

GVoice is a relatively thin wrapper over SMAPI (i.e. you can get really
close to the bare metal) that provides for connection of callbacks and Gtk
signals to various spoken words.  As with SMAPI, words are arranged in
vocabularies you can swap in and out as necessary.  All SMAPI operations
occur asynchronously via the gdk event mechanism, and should be
thread-safe.

Adding simple voice control to your app literally consists of 3+N lines of
code: 

  GV_init("myapplication",&argc,&argv);
  vocab = GV_new_vocab("myvocab");
  GV_connect_word_to_object(vocab,"quit",quit_button,"clicked");
  GV_enable_vocab(vocab);

The really cool part comes when you use libglade for your interfaces:

  window = glade_xml_new("myapp.gld",NULL);
  window_vocab = GV_new_vocab("myapp_window");
  GV_xml_autoconnect(window_vocab,window);
  GV_enable_vocab(window_vocab);

This will take the names (not labels, unsure how to get them for arbitrary
widgets) of all widgets with a "clicked" handler and connect them to that
word in the vocabulary.  Since it's vocabulary-based, you can do this for
each dialog box in your app and enable/disable the vocabularies as you
need them. 

I'll be working on more complex control, including live grammar
construction.  It'd be interesting to have a property page added to Glade
to support complex voice control, such that the resulting XML file can be
parsed by the gvoice code to yield much more robust command of a given
window/dialog box.

GVoice-0.0.1 is available from anakin.cse.ogi.edu in /pub/omega/gvoice. 
You'll need to have the ViaVoice SDK installed, as well as the runtime. 
Both are available from IBM's site, just search for 'viavoice' from the
front page.  Follow the instructions in the package to set up your userid
and enrollid, else it won't work.  You also need libglade to run the demo,
since the autoconnect feature only works on GladeXML structures (so far). 
Then snag this package, build it, and run ./test in demos/.  To verify the
autoconnect, load up glade and muck around with things.  Create any set of
widgets you like, as long as pronunciations exist for those words in the
standard dictionary, it should work.

Have fun,
        Omega

         Erik Walthinsen <omega@cse.ogi.edu> - Staff Programmer @ OGI
        Quasar project - http://www.cse.ogi.edu/DISC/projects/quasar/
   Video4Linux Two drivers and stuff - http://www.cse.ogi.edu/~omega/v4l2/
        __
       /  \             SEUL: Simple End-User Linux - http://www.seul.org/
      |    | M E G A           Helping Linux become THE choice
      _\  /_                          for the home or office user






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]