Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Speech Recognition Manager /
Chapter 1 - Speech Recognition Manager / Speech Recognition Manager Reference
Speech Recognition Manager Routines / Managing Speech Objects


SRGetProperty

You can use the SRGetProperty function to get the current value of a property of a speech object.

pascal OSErr SRGetProperty (
SRSpeechObject srObject, 
OSType selector, 
void *property, 
Size *propertyLen);
srObject
A speech object.
selector
A property selector. See "Recognition System Properties" on page 1-37, "Recognizer Properties" on page 1-40, and "Language Object Properties," beginning on page 1-47 for lists of the available property selectors.
property
The address of a buffer into which the value of the specified property is to be copied.
propertyLen
On entry, the address of a variable of type Size that contains the length, in bytes, of the specified buffer. On exit, if the buffer is large enough to hold the returned property value and no error occurs, SRGetProperty sets propertyLen to the total number of bytes in the value of the specified property. If the buffer is not large enough to hold the returned property value, SRGetProperty sets propertyLen to the number of bytes required to store the requested property and returns the kSRBufferTooSmall error code.
DESCRIPTION
The SRGetProperty function returns, through the property parameter, the value of the property of the speech object specified by the srObject parameter whose type is specified by the selector parameter.

The propertyLen parameter is a pointer to the length of the buffer into which the property value is to be copied. If the value is of a fixed size, then propertyLen should point to a variable of type Size that specifies that size. If the size of the value can vary (for example, if the value is a string), then propertyLen should point to a variable of type Size that specifies the number of bytes in the buffer pointed to by the property parameter. If that buffer is not large enough to hold the returned property value, SRGetProperty sets the variable pointed to by the propertyLen parameter to the actual size of the property value and returns the result code kSRBufferTooSmall as its function result.

Not all selectors are valid for all types of speech objects. If the selector you specify does not specify a property of the specified speech object, SRGetProperty returns the result code kSRCantGetProperty.

SPECIAL CONSIDERATIONS
If SRGetProperty returns an object reference, you must make sure to release that object reference (by calling SRReleaseObject) when you are finished using it. Most selectors do not cause SRGetProperty to return object references. For example, passing the selector kSRSpelling causes SRGetProperty to return a buffer of text, not an object reference.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
22 JAN 1997