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 theGetVoiceDescriptionfunction 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
NILto 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 theGetVoiceInfofunction to mimic theGetVoiceDescriptionfunction, or tosoVoiceFile, 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, thenvoiceInfoshould be a pointer to a voice description record, and thelengthfield of the record should be set to the length of the voice description record. If the selector issoVoiceFile, thenvoiceInfoshould be a pointer to a voice file information record.DESCRIPTION
TheGetVoiceInfofunction accepts a selector in theselectorparameter that determines the type of information you wish to obtain about the voice specified in thevoiceparameter. The function then fills the fields of the data structure appropriate to the selector you specify in thevoiceInfoparameter.If the voice specification is invalid,
GetVoiceInforeturns avoiceNotFounderror. If there is not enough memory to load the voice into memory to obtain information about it,GetVoiceInforeturns the result codememFullErr.SPECIAL CONSIDERATIONS
Because theGetVoiceInfofunction might move memory, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theGetVoiceInfofunction are
Trap macro Selector _SoundDispatch$0614000C RESULT CODES
noErr 0 No error memFullErr -108 Not enough memory to load voice into memory voiceNotFound -244 Voice resource not found