Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 4 - Speech Manager / Speech Manager Reference
Speech Manager Routines / Obtaining Information About Voices


Legacy Documentclose button

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 the GetVoiceDescription 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 the voice parameter specifies an available voice and, if not, returns a voiceNotFound 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
The GetVoiceDescription function fills out the voice description record pointed to by the info parameter with the correct information for the voice specified by the voice parameter. It fills in the length 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 in infoLength before calling GetVoiceDescription. 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 a voiceNotFound error.

SPECIAL CONSIDERATIONS
Because the GetVoiceDescription function moves memory, you should not call it at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the GetVoiceDescription function are
Trap macroSelector
_SoundDispatch$0610000C

RESULT CODES
noErr0No error
paramErr-50Parameter error
memFullErr-108Not enough memory to load voice into memory
voiceNotFound-244Voice resource not found

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996