Carbon


Speech Information Constants

Header: SpeechSynthesis.h

enum {
    soStatus = 'stat',
    soErrors = 'erro',
    soInputMode = 'inpt',
    soCharacterMode = 'char',
    soNumberMode = 'nmbr',
    soRate = 'rate',
    soPitchBase = 'pbas',
    soPitchMod = 'pmod',
    soVolume = 'volm',
    soSynthType = 'vers',
    soRecentSync = 'sync',
    soPhonemeSymbols = 'phsy',
    soCurrentVoice = 'cvox',
    soCommandDelimiter = 'dlim',
    soReset = 'rset',
    soCurrentA5 = 'myA5',
    soRefCon = 'refc',
    soTextDoneCallBack = 'tdcb',
    soSpeechDoneCallBack = 'sdcb',
    soSyncCallBack = 'sycb',
    soErrorCallBack = 'ercb',
    soPhonemeCallBack = 'phcb',
    soWordCallBack = 'wdcb',
    soSynthExtension = 'xtnd',
    soSoundOutput = 'sndo'
};

Constant descriptions

soStatus

Get a speech status information structure for the speech channel. The speechInfo parameter is a pointer to a speech status information structure, described in SpeechStatusInfo.

This selector works with the GetSpeechInfo function and does not move memory.

soErrors

Get saved error information for the speech channel and clear its error registers. This selector lets you poll for various run-time errors that occur during speaking, such as the detection of badly formed embedded commands. Errors returned directly by Speech Manager functions are not reported here. If your application defines an error callback function, the callback should use the soErrors selector to obtain error information. The speechInfo parameter is a pointer to a speech error information structure, described in SpeechErrorInfo.

This selector works with the GetSpeechInfo function and does not move memory.

soInputMode

Get or set the speech channel’s current text-processing mode. The returned value specifies whether the channel is currently in text input mode or phoneme input mode. The speechInfo parameter is a pointer to a variable of type OSType, which specifies a text-processing mode. The constants modeText and modePhonemes specify the available text-processing modes.

The modeText constant indicates that the speech channel is in text-processing mode. The modePhonemes constant indicates that the speech channel is in phoneme-processing mode. When in phoneme-processing mode, a text buffer is interpreted to be a series of characters representing various phonemes and prosodic controls. Some synthesizers might support additional input-processing modes and define constants for these modes.

This selector works with both the GetSpeechInfo and SetSpeechInfo functions. It might move memory only when used in conjunction with the SetSpeechInfo function.

soCharacterMode

Get or set the speech channel’s character-processing mode. Two constants are currently defined for the processing mode, modeNormal and modeLiteral. When the character-processing mode is modeNormal, input characters are spoken as you would expect to hear them. When the mode is modeLiteral, each character is spoken literally, so that the word “cat” would be spoken “C–A–T”. The speechInfo parameter points to a variable of type OSType, which is the character-processing mode.

This selector works with GetSpeechInfo and SetSpeechInfo and does not move memory.

soNumberMode

Get or set the speech channel’s current number-processing mode. Two OSType constants are currently defined, modeNormal and modeLiteral. When the number-processing mode is modeNormal, the synthesizer assembles digits into numbers (so that 12 is spoken as “twelve”). When the mode is modeLiteral, each digit is spoken literally (so that 12 is spoken as “one, two”). The speechInfo parameter is a pointer to a variable of type OSType, which specifies the number-processing mode.

This selector works with both the GetSpeechInfo and SetSpeechInfo functions and does not move memory.

soRate

Get or set a speech channel’s speech rate. The speechInfo parameter is a pointer to a variable of type Fixed. The possible range of speech rates is from 0.000 to 65535.65535. The range of supported rates is not predefined by the Speech Manager; each speech synthesizer provides its own range of speech rates. Average human speech occurs at a rate of 180 to 220 words per minute.

This selector works with both the GetSpeechInfo and SetSpeechInfo functions and does not move memory.

soPitchBase

Get or set the speech channel’s baseline speech pitch. This selector is intended for use by the Speech Manager; ordinarily, an application uses the GetSpeechPitch and SetSpeechPitch functions, described in GetSpeechPitch and SetSpeechPitch, respectively. The speechInfo parameter is a pointer to a variable of type Fixed.

This selector works with both the GetSpeechInfo and SetSpeechInfo functions and does not move memory.

soPitchMod

Get or set a speech channel’s pitch modulation. The speechInfo parameter is a pointer to a variable of type Fixed. Pitch modulation is also expressed as a fixed-point value in the range of 0.000 to 127.000. These values correspond to MIDI note values, where 60.000 is equal to middle C on a piano scale. The most useful speech pitches fall in the range of 40.000 to 55.000. A pitch modulation value of 0.000 corresponds to a monotone in which all speech is generated at the frequency corresponding to the speech pitch. Given a speech pitch value of 46.000, a pitch modulation of 2.000 would mean that the widest possible range of pitches corresponding to the actual frequency of generated text would be 44.000 to 48.000.

This selector works with both the GetSpeechInfo and SetSpeechInfo functions and does not move memory.

soVolume

Get or set the speech volume for a speech channel. The speechInfo parameter is a pointer to a variable of type Fixed. Volumes are expressed in fixed-point units ranging from 0.0 through 1.0. A value of 0.0 corresponds to silence, and a value of 1.0 corresponds to the maximum possible volume. Volume units lie on a scale that is linear with amplitude or voltage. A doubling of perceived loudness corresponds to a doubling of the volume.

This selector works with both the GetSpeechInfo and SetSpeechInfo functions and does not move memory.

soSynthType

Get a speech version information structure for the speech synthesizer being used on the specified speech channel. The speechInfo parameter is a pointer to a speech version information structure, described in SpeechVersionInfo.

This selector works with the GetSpeechInfo function and does not move memory.

soRecentSync

Get the message code for the most recently encountered synchronization command. If no synchronization command has been encountered, 0 is returned. The speechInfo parameter is a pointer to a variable of type OSType.

This selector works with the GetSpeechInfo function and does not move memory.

soPhonemeSymbols

Get a list of phoneme symbols and example words defined for the speech channel’s synthesizer. Your application might use this information to show the user what symbols to use when entering phonemic text directly. The speechInfo parameter is a pointer to a variable of type Handle that, on exit from the GetSpeechInfo function, is a handle to a phoneme descriptor structure, described in PhonemeDescriptor.

This selector works with the GetSpeechInfo function and might move memory. Your application should not invoke it at interrupt time.

soCurrentVoice

Set the current voice on the current speech channel to the specified voice. The speechInfo parameter is a pointer to a voice specification structure. Your application should create the structure by calling MakeVoiceSpec. SetSpeechInfo will return an incompatibleVoice error if the specified voice is incompatible with the speech synthesizer associated with the speech channel. If you have a speech channel open using a voice from a particular synthesizer and you try to switch to a voice that works with a different synthesizer, you receive an incompatibleVoice error. You need to create a new channel to use with the new voice.

This selector works with only SetSpeechInfo and might move memory. Your application should not invoke it at interrupt time.

soCommandDelimiter

Set the embedded speech command delimiter characters to be used for the speech channel. By default the opening delimiter is “[[” and the closing delimiter is “]]”. Your application might need to change these delimiters temporarily if those character sequences occur naturally in a text buffer that is to be spoken. Your application can also disable embedded command processing by passing empty delimiters (2 NULL bytes). The speechInfo parameter is a pointer to a delimiter information structure, described in DelimiterInfo.

This selector works with the SetSpeechInfo function and does not move memory.

soReset

Set a speech channel back to its default state. For example, speech pitch and speech rate are set to default values. The speechInfo parameter should be set to NULL.

This selector works with the SetSpeechInfo function and does not move memory.

soCurrentA5

Set the value that the Speech Manager assigns to the A5 register before invoking any application-defined callback functions for the speech channel. The A5 register must be set correctly if the callback functions are to be able to access application global variables. The speechInfo parameter should be set to the pointer contained in the A5 register at a time when the application is not executing interrupt code or to NULL if your application wishes to clear a value previously set with the soCurrentA5 selector.

This selector works with the SetSpeechInfo function and does not move memory.

soRefCon

Set a speech channel’s reference constant value. The reference constant value is passed to application-defined callback functions and might contain any value convenient for the application. The speechInfo parameter is a long integer containing the reference constant value. In contrast with other selectors, this selector does not require that the speechInfo parameter’s value be a pointer value. Typically, however, an application does use this selector to pass a pointer or handle value to callback functions.

This selector works with the SetSpeechInfo function and does not move memory.

soTextDoneCallBack

Set the callback function to be called when the Speech Manager has finished processing speech being generated on the speech channel. The speechInfo parameter is a pointer to an application-defined text-done callback function, whose syntax is described in SpeechTextDoneProcPtr. Passing NULL in speechInfo disables the text-done callback function.

This selector works with the GetSpeechInfo function and does not move memory.

soSpeechDoneCallBack

Set the callback function to be called when the Speech Manager has finished generating speech on the speech channel. The speechInfo parameter is a pointer to an application-defined speech-done callback function, whose syntax is described in SpeechDoneProcPtr. Passing NULL in speechInfo disables the speech-done callback function.

This selector works with the SetSpeechInfo function and does not move memory.

soSyncCallBack

Set the callback function to be called when the Speech Manager encounters a synchronization command within an embedded speech command in text being processed on the speech channel. The speechInfo parameter is a pointer to an application-defined synchronization callback function, whose syntax is described in SpeechSyncProcPtr. Passing NULL in speechInfo disables the synchronization callback function.

This selector works with the SetSpeechInfo function and does not move memory.

soErrorCallBack

Set the callback function to be called when an error is encountered during the processing of an embedded command. The callback function might also be called if other conditions (such as insufficient memory) arise during the speech conversion process. When a Speech Manager function returns an error directly, the error callback function is not called. The callback function is passed information about the most recent error; it can determine information about the oldest pending error by using the speech information selector soErrors. The speechInfo parameter is a pointer to an application-defined error callback function. Passing NULL in speechInfo disables the error callback function, SpeechErrorProcPtr.

This selector works with the SetSpeechInfo function and does not move memory.

soPhonemeCallBack

Set the callback function to be called every time the Speech Manager is about to generate a phoneme on the speech channel. The speechInfo parameter is a pointer to an application-defined phoneme callback function, whose syntax is described in SpeechPhonemeProcPtr. Passing NULL in speechInfo disables the phoneme callback function.

This selector works with the SetSpeechInfo function and does not move memory.

soWordCallBack

Set the callback function to be called every time the Speech Manager is about to generate a word on the speech channel. The speechInfo parameter is a pointer to an application-defined word callback function, whose syntax is described in SpeechWordProcPtr. Passing NULL in speechInfo disables the word callback function.

This selector works with the SetSpeechInfo function and does not move memory.

soSynthExtension

Get or set synthesizer-specific information or settings. The speechInfo parameter is a pointer to a speech extension data structure, described in SpeechXtndData. Your application should set the synthCreator field of this structure before calling GetSpeechInfo or SetSpeechInfo. Ordinarily, your application must pass additional information to the synthesizer in the synthData field.

This selector works with both the GetSpeechInfo and SetSpeechInfo functions. Whether it moves memory depends on the synthesizer being used and the information passed to the synthesizer.

soSoundOutput

These constants are passed in the selector parameter of the GetSpeechInfo and SetSpeechInfo functions.


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