![]() |
Recognizer Properties |
Header: SpeechRecognition.h |
enum { kSRNotificationParam = 'noti', kSRCallBackParam = 'call', kSRSearchStatusParam = 'stat', kSRAutoFinishingParam = 'afin', kSRForegroundOnly = 'fgon', kSRBlockBackground = 'blbg', kSRBlockModally = 'blmd', kSRWantsResultTextDrawn = 'txfb', kSRWantsAutoFBGestures = 'dfbr', kSRSoundInVolume = 'volu', kSRReadAudioFSSpec = 'aurd', kSRCancelOnSoundOut = 'caso', kSRSpeedVsAccuracyParam = 'sped' };
The notification property. The value of this property is a 4-byte unsigned integer whose bits encode the kinds of events of which the recognizer will notify your application. See the section
The callback property. The value of this property is of type SRCallBackParam that determines whether recognition notifications are sent to your application via Apple events or via an application-defined callback routine. To specify a callback routine, set the value of this property to the address of a callback routine parameter structure. By default, the value of a recognizers callback property is NULL, indicating that Apple events are to be used to report recognizer events.
The search status. The value of this property is a 4-byte unsigned integer whose bits indicate the current state of the recognizer. See the section
The foreground-only flag. The value of this property is a Boolean value that indicates whether the recognizer is enabled only when your application is the foreground application (TRUE) or not (FALSE). By default, the value of a recognizers foreground-only flag is TRUE.
The background-blocking flag. The value of this property is a Boolean value that indicates whether all recognizers owned by other applications are automatically disabled whenever your application is the foreground application (TRUE) or are not automatically disabled (FALSE). By default, the value of a recognizers background-blocking flag is FALSE.
The modal-blocking flag. The value of this property is a Boolean value that indicates whether the language model associated with this recognizer is the only active language model (TRUE) or not (FALSE). When this flag is TRUE, your applications recognizer blocks those of other applications even when it is not the foreground application; in addition, the feedback window is hidden if you are not using it. Setting this property to TRUE prevents speech recognition from working for other applications, so you want to use this property only if your application is taking over the computer (like some games) or briefly attempting to constrain the language model severely. By default, the value of a recognizers modal-blocking flag is FALSE.
The text feedback flag. The value of this property is a Boolean value that indicates whether the results of a search are to be automatically displayed as text in the feedback window (TRUE) or not (FALSE). If you set the value of this property to FALSE, you should call SRDrawRecognizedText with a string representing what the user said. By default, the value of a recognizers text feedback flag is TRUE.
The automatic feedback gestures flag. The value of this property is a Boolean value that determines whether the feedback gestures are automatically drawn (TRUE) or not (FALSE). If you want more control over feedback behavior, you should set this property to FALSE; then call SRProcessBegin when you want to begin responding to a spoken request and SRProcessEnd when you are finished. During that time, the feedback character displays appropriate animated gestures to indicate that it is busy performing the task. By default, the value of a recognizers automatic feedback gestures flag is TRUE.
The sound input volume. The value of this property is a 2-byte unsigned integer between 0 and 100, inclusive, that indicates the current sound input volume. This property is read-only; you cannot set a property of this type.
The audio file property. You can use this property to perform speech recognition from an audio file. The value of this property is a pointer to a file system specification (a structure of type FSSpec). The file system specification indicates an AIFF file that contains raw audio data (16-bit audio data sampled at 22.050 kHz). After you create a new recognizer using the speech source ID kSRCanned22kHzSpeechSource, you must set this recognizer property to perform recognition from an audio file. Setting the audio source to a file also allows the Speech Recognition Manager to process sound data at system background time rather than at interrupt time or deferred task time.
The cancel during sound output flag. The value of this property is a Boolean value that indicates whether speech recognition is canceled whenever any sound is output by the computer during an utterance (TRUE) or whether speech recognition continues (FALSE). By default, the value of a recognizers cancel during sound output flag is TRUE.
Every recognizer has a set of properties that you can inspect and change by calling the SRGetProperty and SRSetProperty functions. You specify a property by passing a property selector to those functions. The Speech Recognition Manager defines these property selectors for recognizers.
© 2000 Apple Computer, Inc. (Last Updated 7/10/2000)