Sphinx-4 Dialog Demo |
This is a simple command line program that demonstrates how to swap
between multiple JSGF and dictation grammars .
Check if the bin
directory already has the Dialog.jar
file. If not, type the following in the top level directory:
ant -find demo.xml
First make sure that you have JSAPI setup correctly. Then, to run the demo, type:
sphinx4> java -mx200m -jar bin/Dialog.jar
NOTE:
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 menu of commands
that can be spoken. Here is a sample run. The spoken commands are
highlighed in green.
Note that this is just a demonstration of the speech technology. This
demo will not actually perform the command. Thus, when you say "play
games / play adventure " no game will actually played, similarly, when
you say "make a phone call / call paul" no phone call will be made.
Note - when browsing newspapers from the 'news' menu, this demo will actually attempt to open the news page in your web browser by executing the command 'browse web-page-url'. If you want to enable this feature place a browse script in your command path. The script I use with the firefox browser is this:
#!/bin/sh export FF_HOME="/usr/share/firefox url="$1" if [ "x$url" = "x" ]; then url="about:blank" fi if $FF_HOME/mozilla-xremote-client openURL\("$url"\); then exit 0 fi exec $FF_HOME/firefox "$url"Here's a sample run:
Welcome to the Sphinx-4 Dialog Demo - Version 1.0 Loading dialogs ... Loading weather recognizer ... Running ... ======== menu ======= exit the program get help listen to music make a phone call play a game read a book read a newspaper read my email show statistics watch a movie weather forecaster ================================= get help ======== menu ======= exit the program get help listen to music make a phone call play a game read a book read a newspaper read my email show statistics watch a movie weather forecaster ================================= listen to music ======== music ======= go to main menu go to the main menu listen to alter bridge open your eyes listen to audio slave i am the highway listen to audio slave like a stone listen to audio slave show me how to live listen to damage plan pride listen to drowning pool set up listen to eighteen twelve overture listen to emerson lake and palmer tank listen to green day american idiot listen to jet are you going to be my girl listen to jimmy smith the cat listen to led zeppelin rambling on listen to monkeys i'm a believer listen to monster magnet unbroken listen to nickle back figured you out listen to pink floyd money listen to red hot chili peppers fortune faded listen to rick wakeman journey to the center of the earth listen to shine down forty five listen to shine down simple man listen to tantric after we go listen to the who tommy listen to three one one love song listen to usher burn listen to van halen it's about time listen to velvet revolver fall to pieces listen to velvet revolver slither ================================= listen to red hot chili peppers fortune faded listen to rick wakeman journey to the center of the earth go to the main menu ======== menu ======= exit the program get help listen to music make a phone call play a game read a book read a newspaper read my email show statistics watch a movie weather forecaster ================================= read a newspaper ======== news ======= get help go to main menu go to the main menu main menu read the boston globe read the chicago tribune read the daily mirror read the daily prophet 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 nashua telegraph go to the main menu ======== menu ======= exit the program get help listen to music make a phone call play a game read a book read a newspaper read my email show statistics watch a movie weather forecaster ================================= watch a movie ======== movies ======= get help go to main menu go to the main menu main menu watch a beautiful mind watch american beauty watch brave heart watch chicago watch finding nemo watch gladiator watch lord of the rings watch mystic river watch ordinary people watch out of africa watch platoon watch rain man watch star wars watch terms of endearment watch the empire strikes back watch the english patient watch the italian job watch the last emperor watch the magnificent seven 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 two thousand one a space odyssey go to the main menu ======== menu ======= exit the program get help listen to music make a phone call play a game read a book read a newspaper read my email show statistics watch a movie weather forecaster ================================= show statistics # ----------------------------- Timers---------------------------------------- # Name Count CurTime MinTime MaxTime AvgTime TotTime microphone 4580 0.0000s 0.0000s 0.1400s 0.0087s 39.7850s nonSpeechDataFi 2005 0.0000s 0.0000s 6.6120s 0.0114s 22.9080s premphasizer 2005 0.0000s 0.0000s 0.0020s 0.0000s 0.0110s windower 1979 0.0000s 0.0000s 0.0140s 0.0001s 0.1380s fft 1992 0.0000s 0.0000s 0.0150s 0.0004s 0.7810s melFilterBank 1992 0.0000s 0.0000s 0.0040s 0.0000s 0.0590s dct 1992 0.0000s 0.0000s 0.0160s 0.0001s 0.1110s liveCMN 1992 0.0000s 0.0000s 0.0030s 0.0000s 0.0120s featureExtracti 1940 0.0000s 0.0000s 0.0050s 0.0000s 0.0410s AM_Load 1 16.4160s 16.4160s 16.4160s 16.4160s 16.4160s DictionaryLoad 2 1.7030s 1.7030s 3.0790s 2.3910s 4.7820s grammarLoad 1 0.2200s 0.2200s 0.2200s 0.2200s 0.2200s compile 9 0.0450s 0.0450s 8.8240s 1.3280s 11.9520s createGStates 8 0.0000s 0.0000s 0.0320s 0.0050s 0.0400s collectContex 8 0.0040s 0.0010s 0.0290s 0.0068s 0.0540s expandStates 8 0.0400s 0.0400s 2.2290s 0.3589s 2.8710s connectNodes 8 0.0000s 0.0000s 0.1070s 0.0192s 0.1540s scoring 1979 0.0000s 0.0000s 6.6140s 0.0214s 42.3680s pruning 1966 0.0000s 0.0000s 0.0020s 0.0000s 0.0080s growing 1979 0.0000s 0.0000s 0.0760s 0.0005s 0.9050s buildHmmPool 1 8.4090s 8.4090s 8.4090s 8.4090s 8.4090s Create HMMTree 1 0.3840s 0.3840s 0.3840s 0.3840s 0.3840s weather forecaster Give your best imitation of a british weather forecaster Say 'forecast over' when you are done. Forecast: very windy with strong southerly winds gusting up to fifty or sixty mph Forecast: misty in the south and southeast with patchy drizzle and risk of fog Forecast: clear with most places dry and sunny Forecast: continuing mild with a moderate to fresh southerly breeze Forecast: forecast over ======== menu ======= exit the program get help listen to music make a phone call play a game read a book read a newspaper read my email show statistics watch a movie weather forecaster ================================= read a book ======== books ======= get help go to main menu go to the main menu main 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 the lord of the rings read the curious incident of the dog in the night time go to the main menu ======== menu ======= exit the program get help listen to music make a phone call play a game read a book read a newspaper read my email show statistics watch a movie weather forecaster ================================= make a phone call ======== phone ======= call arthur call bhiksha call evandro call glen call james call joe call joseph call karl call nicole call paul call pedro call peter call phil call philip call rich call rita call steve call will call willie get help go to main menu go to the main menu main menu ================================= call bhiksha call rita go to the main menu ======== menu ======= exit the program get help listen to music make a phone call play a game read a book read a newspaper read my email show statistics watch a movie weather forecaster ================================= exit the program Goodbye! Thanks for visiting!
Will remain dry apart from perhaps a little drizzle near the northwest coast. Extensive mist and fog patches expected also. Some fog also. Frost likely in many places. Any rain or drizzle will die out tomorrow and sunny spells will develop. Cloudy tonight in the north and northeast with some light rain or drizzle in places. Fresh or strong gusty southwest to west winds gradually veering northwesterly. Mostly dry calm and clear overnight with little or no wind. Severe ground frost developing. Rain or drizzle in the north and northeast will clear tomorrow leaving a dry day with sunny spells in most areas. Scattered blustery showers largely dying out later. Fair weather in all areas, rain in the south and west later. Showers will slowly become more isolated tonight. A very cold night. Continuing mild with a moderate to fresh southerly breeze. Scattered showers with a risk of thunder later. Becoming windy overnight but very mild. Widespread haze and mist with scattered outbreaks of rain. A few sunny breaks will develop by afternoon principally in the western half of the country. A second low pressure centre will move in across northern areas tomorrow. Cold and windy with occasional showers. Continuing rather cloudy over most parts of the country. Tomorrow any fog, low cloud and drizzle will clear with most places dry and sunny. It will be cold overnight in most parts of the country with some clear spells. A weak ridge of high pressure will cross the country tonight. Rain spreading to all areas from the west followed later by heavy showers. Weather mainly fair if rather hazy. The rest of the night will be dry in most areas though a few showers are still possibly across northern and northeastern counties. Windy with rain extending to all parts during the morning. The rain becoming heavy in many areas. Very windy with strong southerly winds gusting up to fifty or sixty mph. Rain in the south and west will spread to remaining north east areas overnight, heavy and persistent in places. Clouds will increase from the west as the day goes on. Misty in the south and southeast with patchy drizzle and a risk of fog. The rest of the country will be overcast with outbreaks of rain heaviest and most persistent in the south and southwest.