Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 4 - Speech Manager / Speech Manager Reference
Speech Manager Routines / Changing Speech Attributes


Legacy Documentclose button

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.

SetSpeechPitch

You can use the SetSpeechPitch function to set the speech pitch on a designated speech channel.

FUNCTION SetSpeechPitch (chan: SpeechChannel; pitch: Fixed)
                           : OSErr;
chan
The speech channel whose pitch you wish to set.
pitch
The new pitch for the speech channel, expressed as a fixed-point frequency value.
DESCRIPTION
The SetSpeechPitch function changes the current speech pitch on the speech channel specified by the chan parameter to the pitch specified by the pitch parameter. Typical voice frequencies range from around 90 hertz for a low-pitched male voice to perhaps 300 hertz for a high-pitched child's voice. These frequencies correspond to approximate pitch values in the ranges of 30.000 to 40.000 and 55.000 to 65.000, respectively. For information about the mathematical relationship between pitches and frequencies expressed in hertz, see "Speech Attributes" beginning on page 4-6. Although fixed-point values allow you to specify a wide range of pitches, not all synthesizers will support the full range of pitches. If your application specifies a pitch that a synthesizer cannot handle, it may adjust the pitch to fit within an acceptable range.

SPECIAL CONSIDERATIONS
You can call the SetSpeechPitch function at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the SetSpeechPitch function are
Trap macroSelector
_SoundDispatch$044C000C

RESULT CODES
noErr0No error
invalidComponentID-3000Speech channel is uninitialized or bad

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996