Important: The information in this document is obsolete and should not be used for new development.
SRGetProperty
You can use theSRGetProperty
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
setspropertyLen
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
setspropertyLen
to the number of bytes required to store the requested property and returns thekSRBufferTooSmall
error code.DESCRIPTION
TheSRGetProperty
function returns, through theproperty
parameter, the value of the property of the speech object specified by thesrObject
parameter whose type is specified by theselector
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, thenpropertyLen
should point to a variable of typeSize
that specifies that size. If the size of the value can vary (for example, if the value is a string), thenpropertyLen
should point to a variable of typeSize
that specifies the number of bytes in the buffer pointed to by theproperty
parameter. If that buffer is not large enough to hold the returned property value,SRGetProperty
sets the variable pointed to by thepropertyLen
parameter to the actual size of the property value and returns the result codekSRBufferTooSmall
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 codekSRCantGetProperty
.SPECIAL CONSIDERATIONS
IfSRGetProperty
returns an object reference, you must make sure to release that object reference (by callingSRReleaseObject
) when you are finished using it. Most selectors do not causeSRGetProperty
to return object references. For example, passing the selectorkSRSpelling
causesSRGetProperty
to return a buffer of text, not an object reference.