Sphinx-4 JSGF Demo

This is a simple command line program that demonstrates how to swap between multiple JSGF grammars .

Building

Check if the bin directory already has the JSGFDemo.jar file. If not, type the following in the top level directory:

ant -find demo.xml

Running

First make sure that you have JSAPI setup correctly. Then, to run the demo, type:

sphinx4> java -mx200m -jar bin/JSGFDemo.jar

NOTE:

  1. Make sure that you give it a large enough heap by putting in "-mx200m".
  2. Make sure that you are using JavaTM 2 SDK, Standard Edition, v1.4 or higher.
  3. If you are running Linux and have problems with the audio, please read the Linux JavaSound section.
  4. If you have the source distribution, make sure that the JAR file lib/sphinx4.jar is built. If not, go to the top level directory and type: ant


When the program runs, you will be presented with a series of command menues that can be spoken. The first menu contains a set of movie titles that you can 'watch', the second menu contains a set of newspapers that you can 'read', the third menu contains a set of books that you can 'read', and finally the last menu contains a set of songs that you can 'listen' to. Note that this is just a demonstration of the speech technology. This demo will not actually allow you to 'watch' a movie, 'read' a book or 'listen to music' Here is a sample run.  The spoken commands are highlighed in green. 

JSGF Demo Version 1.0

 Loading recognizer ... Ready
 ====== movies ======
Speak one of: 

go to the next menu
watch a beautiful mind
watch american beauty
watch brave heart
watch chariots of fire
watch chicago
watch dances with wolves
watch driving miss daisy
watch finding nemo
watch gladiator
watch lord of the rings
watch ordinary people
watch out of africa
watch platoon
watch rain man
watch shakespeare in love
watch spider man
watch terms of endearment
watch the empire strikes back
watch the italian job
watch the matrix
watch the silence of the lambs
watch titanic
watch two thousand one a space odyssey
watch unforgiven
 ============================

  watch lord of the rings
  watch the empire strikes back
  go to the next menu


 ====== news ======
Speak one of: 

go to the next menu
read planet sun
read the boston globe
read the chicago tribune
read the daily mirror
read the guardian
read the los angeles times
read the nashua telegraph
read the new york times
read the san francisco chronicle
read the san jose mercury news
read the sun
read the wall street journal
read the washington post
 ============================

  read the new york times
  read the nashua telegraph
  go to the next menu



 ====== books ======
Speak one of: 

go to the next menu
read angels and demons
read code and other laws of cyber space
read eats shoots and leaves
read effective java
read harry potter and the goblet of fire
read spoken language processing
read the curious incident of the dog in the night time
read the da vinci code
read the future of ideas
read the lord of the rings
read the time travelers wife
 ============================

  read harry potter and the goblet of fire
  read the curious incident of the dog in the night time
  go to the next menu



 ====== music ======
Speak one of: 

go to the next menu
listen to as time goes by
listen to diamonds are a girl's best friend
listen to moon river
listen to mrs robinson
listen to over the rainbow
listen to singing in the rain
listen to staying alive
listen to the man that got away
listen to the sound of music
listen to the way we were
listen to when you wish upon a star
listen to white christmas
 ============================

  listen to the sound of music
  listen to over the rainbow
  go to the next menu




Done. Cleaning up ... Goodbye.

Code Notes

This demo shows how a JSGFGrammar component can be used by your application to select enable different JSGF grammars. The steps involved are:
Copyright 1999-2004 Carnegie Mellon University.
Portions Copyright 2002-2004 Sun Microsystems, Inc.
Portions Copyright 2002-2004 Mitsubishi Electric Research Laboratories.
All Rights Reserved. Usage is subject to license terms.