by Michael J. Norton
Giving a machine the ability to converse with people has been the subject of many science fiction stories. There was the ominous Robby the Robot, in the 1956 MGM film, "The Forbidden Planet," constructed from the marvels of Krell technology. Don't forget the friendly and protective B9 robot from "Lost in Space" that every child of the sixties wished they owned. How about the devious HAL 2000, which was nothing more than a camera lens, but it spoke and taunted its sole victim, Dave, in "2001 Space Odyssey."
As a child, these science-fiction machines that could talk mesmerized me. With dates like 1997, for "Lost in Space," and 2001, I was given hope that these contraptions would someday exist in my future. It was a technology that would someday come. That someday crept up on all of us silently. In fact, this technology has been shipping on Apple Macintosh computers for at least five years now. To my dismay, however, there are still no talking space robots.
With the advent of G4 supercomputers, the anxiously awaited Unix Mach kernel-based Mac OS X operating system, multimedia capabilities, and speech recognition, perhaps we are within the grasp of Krell technology. All the ingredients are certainly present to make our system interact with us vocally. Maybe all we really need is a road map on how to use the new technology.
The Speech Recognition Manager
The Mac operating system ships with speech recognition and speech-to-text capabilities. PlainTalk is the software package that provides the operating system with the functionality required for your Macintosh to respond to your voice and to speak written text. The PlainTalk package comprises two software components, the Speech Recognition Manager and the Speech Synthesis Manager. The Speech Recognition Manager listens for our spoken words and phrases. The Speech Synthesis Manager allows the Mac to speak back to the user.
The Speech Recognition Manager and Speech Synthesis Manager are standard packages that ship with current versions of the Mac OS. If you're running Mac OS 8 or greater, then your operating system supports these managers. If you need a current image of these managers, you can download them from the Apple Speech web site. To see if your system has Speakable Items, select Speech from the pull-down control panel menu (see Figure 1). For my new G4 system I did need to download the Speech Recognition Manager. Speakable Items wasn't present in my operating system Speech control panel options menu.
Figure 1. Speech Control Panel.
To use Apple's speech recognition software you must open a recognition system. We'll soon explore how to code a recognition system. For the time being, you can open a simple recognition system from your control panel. Select the Speech control panel and enable speech by turning Speakable Items on. After selecting the On radio button, you should immediately hear the Speech Synthesis Manager informing you verbally that the Speakable Items software is running. A window will open that is a component of the Speech Recognition Manager, your feedback window. The feedback window on my desktop is provided as an example; see Figure 2.
Figure 2. Feedback window.
The Speakable Items components are fully configurable through the control panel so you can customize the character in the window and its synthetic voice. The components you select in this window will also be used when you start playing with your speech recognition code.
Downloading the Speech Recognition Manager SDK
Developing applications that use the Speech Recognition Manager require the Speech Recognition Manager SDK. This is free from Apple Computer. The development libraries in this SDK assume that you are using the Metrowerks CodeWarrior. You also can use the MPW development environment, which also is available free from Apple. Some mangling and recompiling of the headers and libraries is required, but MPW can be used.
The major difference is that Metrowerks CodeWarrior is a full-featured integrated development environment while MPW is command-line and script based. A strong knowledge of make files is a must for using MPW. The example provided for this article will use Metrowerks CodeWarrior. However, the source code will build under both environments. Keep in mind that with Mac OS X, Apple has no intention of maintaining MPW.