Function

GetVoiceDescription

Gets a description of a voice by using the GetVoiceDescription function.

Declaration

OSErr GetVoiceDescription(const VoiceSpec *voice, VoiceDescription *info, long infoLength);

Parameters

voice

A pointer to the voice specification structure identifying the voice to be described, or NULL to obtain a description of the system default voice.

info

A pointer to a voice description structure. If this parameter is NULL, the function does not fill in the fields of the voice description structure; 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 structure. In the current version of the Speech Synthesis Manager, the voice description structure contains 362 bytes. However, you should always use the SizeOf function to determine the length of this structure.

Return Value

A result code. See Result Codes.

Discussion

The GetVoiceDescription function fills out the voice description structure 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 structure 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 Synthesis Manager to work on future versions that might have longer voice description structures; it also allows you to write code for future versions of the Speech Synthesis Manager that will also run on computers that support only the current version.

If the voice specification structure does not identify an available voice, GetVoiceDescription returns a voiceNotFound error.

See Also

Getting Information About Voices

CountVoices

Determines how many voices are available.

GetIndVoice

Gets a voice specification structure for a voice by passing an index to the GetIndVoice function.

GetVoiceInfo

Gets the same information about a voice that the GetVoiceDescription function provides, or to determine in which file and resource a voice is stored.

MakeVoiceSpec

Sets the fields of a voice specification structure.