[ This chapter does not appear in the book. ]
The ProfBob application is a mildly amusing example of speech synthesis, utilizing the freeTTS implementation of the Java Speech API (JSAPI).
The image above shows the prodigiously talented Professor Bob ready for action.
The user enters a query into the "Message" text field, and Prof. Bob speaks a suitable response, while the text of that response appears in the "Response" textfield. Bob's mouth moves while the response is being spoken.
Aside from the use of speech synthesis, Prof. Bob is mostly "smoke and mirrors". His responses are generated by looking for predetermined keywords in the input text, and if nothing suitable is found, Bob falls back to vague rejoinders such as "Please go on". Bob's animated expression is achieved by moving a picture of his mouth up and down over his face.
In defense of this 'stage magic' style of programming, canned responses and simple graphics are arguably good enough for many kinds of user interaction (e.g. help desks, game avatars), and are easy to implement and extend. The alternative would be the grammatical parsing of the user's input, and 2D animation that emulates the large range of possible facial expressions.