Carbon


TextToPhonemes

Header: SpeechSynthesis.h Carbon status: Supported

Converts textual data into phonemic data.

OSErr TextToPhonemes (
    SpeechChannel chan, 
    const void *textBuf, 
    UInt32 textBytes, 
    Handle phonemeBuf, 
    SInt32 *phonemeBytes
);
Parameter descriptions
chan

A speech channel whose associated synthesizer and voice are to be used for the conversion process.

textBuf

A pointer to a buffer of text to be converted.

textBytes

The number of bytes of text to be converted.

phonemeBuf

A handle to a buffer to be used to store the phonemic data. The TextToPhonemes function may resize the relocatable block referenced by this handle.

phonemeBytes

On return, a pointer to the number of bytes of phonemic data written to the handle.

function result

A result code.

DISCUSSION

Converting textual data into phonetic data is particularly useful during application development, when you might wish to adjust phrases that your application generates to produce smoother speech. By first converting the target phrase into phonemes, you can see what the synthesizer will try to speak. Then you need correct only the parts that would not have been spoken the way you want.

The TextToPhonemes function converts the textBytes bytes of textual data pointed to by the textBuf parameter to phonemic data, which it writes into the relocatable block specified by the phonemeBuf parameter. If necessary, TextToPhonemes resizes this relocatable block. The TextToPhonemes function sets the phonemeBytes parameter to the number of bytes of phonetic data actually written.

If the textual data is contained in a relocatable block, a handle to that block must be locked before the TextToPhonemes function is called.

The data returned by TextToPhonemes corresponds precisely to the phonemes that would be spoken had the input text been sent to SpeakText instead. All current mode settings for the speech channel specified by chan are applied to the converted speech. No callbacks are generated while the TextToPhonemes function is generating its output.

SPECIAL CONSIDERATIONS

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

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)