Important: The information in this document is obsolete and should not be used for new development.
SRGetProperty
You can use theSRGetPropertyfunction 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
Sizethat 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,SRGetPropertysetspropertyLento 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,SRGetPropertysetspropertyLento the number of bytes required to store the requested property and returns thekSRBufferTooSmallerror code.DESCRIPTION
TheSRGetPropertyfunction returns, through thepropertyparameter, the value of the property of the speech object specified by thesrObjectparameter whose type is specified by theselectorparameter.The
propertyLenparameter 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, thenpropertyLenshould point to a variable of typeSizethat specifies that size. If the size of the value can vary (for example, if the value is a string), thenpropertyLenshould point to a variable of typeSizethat specifies the number of bytes in the buffer pointed to by thepropertyparameter. If that buffer is not large enough to hold the returned property value,SRGetPropertysets the variable pointed to by thepropertyLenparameter to the actual size of the property value and returns the result codekSRBufferTooSmallas 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,
SRGetPropertyreturns the result codekSRCantGetProperty.SPECIAL CONSIDERATIONS
IfSRGetPropertyreturns an object reference, you must make sure to release that object reference (by callingSRReleaseObject) when you are finished using it. Most selectors do not causeSRGetPropertyto return object references. For example, passing the selectorkSRSpellingcausesSRGetPropertyto return a buffer of text, not an object reference.