Important: Inside Macintosh: Sound is deprecated as of Mac OS X v10.5. For new audio development in Mac OS X, use Core Audio. See the Audio page in the ADC Reference Library.
GetVoiceDescription
You can obtain a description of a voice by using theGetVoiceDescription
function.
FUNCTION GetVoiceDescription (voice: VoiceSpecPtr; info: VoiceDescriptionPtr; infoLength: LongInt): OSErr;
voice
- A pointer to the voice specification record identifying the voice to be described, or
NULL
to obtain a description of the system default voice.info
- A pointer to a voice description record. If this parameter is
NULL
, the function does not fill in the fields of the voice description record; instead, it simply determines whether thevoice
parameter specifies an available voice and, if not, returns avoiceNotFound
error.infoLength
- The length, in bytes, of the voice description record. In the current version of the Speech Manager, the voice description record contains 362 bytes. However, you should always use the
SizeOf
function to determine the length of this record.DESCRIPTION
TheGetVoiceDescription
function fills out the voice description record pointed to by theinfo
parameter with the correct information for the voice specified by thevoice
parameter. It fills in thelength
field of the voice description record with the number of bytes actually copied. This value will always be less than or equal to the value that your application passes ininfoLength
before callingGetVoiceDescription
. This scheme allows applications targeted for the current version of the Speech Manager to work on future versions that might have longer voice description records; it also allows you to write code for future versions of the Speech Manager that will also run on computers that support only the current version.If the voice specification record does not identify an available voice,
GetVoiceDescription
returns avoiceNotFound
error.SPECIAL CONSIDERATIONS
Because theGetVoiceDescription
function moves memory, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theGetVoiceDescription
function are
Trap macro Selector _SoundDispatch
$0610000C RESULT CODES
noErr 0 No error paramErr -50 Parameter error memFullErr -108 Not enough memory to load voice into memory voiceNotFound -244 Voice resource not found