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 theGetVoiceDescription
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 theGetVoiceInfo
function to mimic theGetVoiceDescription
function, 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
, thenvoiceInfo
should be a pointer to a voice description record, and thelength
field of the record should be set to the length of the voice description record. If the selector issoVoiceFile
, thenvoiceInfo
should be a pointer to a voice file information record.DESCRIPTION
TheGetVoiceInfo
function accepts a selector in theselector
parameter that determines the type of information you wish to obtain about the voice specified in thevoice
parameter. The function then fills the fields of the data structure appropriate to the selector you specify in thevoiceInfo
parameter.If the voice specification is invalid,
GetVoiceInfo
returns avoiceNotFound
error. If there is not enough memory to load the voice into memory to obtain information about it,GetVoiceInfo
returns the result codememFullErr
.SPECIAL CONSIDERATIONS
Because theGetVoiceInfo
function might move memory, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theGetVoiceInfo
function 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