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.

GetVoiceInfo

You can use the GetVoiceInfo function to obtain the same information about a voice that the GetVoiceDescription function provides or to determine in which file and resource a voice is stored. This function is intended primarily for use by synthesizers, but an application can call it too.

FUNCTION GetVoiceInfo (voice: VoiceSpecPtr; selector: OSType; 
                        voiceInfo: Ptr): OSErr;
voice
A pointer to the voice specification record identifying the voice about which your application requires information, or NIL to obtain information on the system default voice.
selector
A specification of the type of data being requested. For current versions of the Speech Manager, you should set this field either to soVoiceDescription, if you would like to use the GetVoiceInfo function to mimic the GetVoiceDescription function, or to soVoiceFile, if you would like to obtain information about the location of a voice on disk.
voiceInfo
A pointer to the appropriate data structure. If the selector is soVoiceDescription, then voiceInfo should be a pointer to a voice description record, and the length field of the record should be set to the length of the voice description record. If the selector is soVoiceFile, then voiceInfo should be a pointer to a voice file information record.
DESCRIPTION
The GetVoiceInfo function accepts a selector in the selector parameter that determines the type of information you wish to obtain about the voice specified in the voice parameter. The function then fills the fields of the data structure appropriate to the selector you specify in the voiceInfo parameter.

If the voice specification is invalid, GetVoiceInfo returns a voiceNotFound error. If there is not enough memory to load the voice into memory to obtain information about it, GetVoiceInfo returns the result code memFullErr.

SPECIAL CONSIDERATIONS
Because the GetVoiceInfo function might move memory, you should not call it at interrupt time.

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

RESULT CODES
noErr0No 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