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.
Chapter 4 - Speech Manager
This chapter describes the Speech Manager, the part of the Macintosh system software that provides a standardized method for Macintosh applications to generate synthesized speech.You need to read this chapter if you want your application to be able to generate speech. For example, you may want your application to incorporate the capability to speak its dialog box messages to the user. A word-processing application might use the Speech Manager to implement a command that speaks a selected section of a document to the user. A multimedia application might use the Speech Manager to provide a narration of a QuickTime movie instead of including sampled-sound data on a movie track. Because sound samples can take up large amounts of room on disk, using text in place of sampled sound is extremely efficient.
If you are developing an application that needs only to generate speech from strings, then the information on speech contained in the chapter "Introduction to Sound on the Macintosh" in this book might be sufficient. If, however, you need to be able to manipulate the speech output or customize it to make it easier for your users to understand, you should read this chapter.
The Speech Manager is not available in all system software versions. It was introduced with the Macintosh computers with audio visual capabilities in the summer of 1993. It will continue to be incorporated into future versions of system software. You should use the
Gestalt
function to ensure that the speech services you need are available before calling them. See the discussion in the section "Checking for Speech Manager Capabilities" beginning on page 4-12 for details.The Speech Manager and the Sound Manager adopt many of the same metaphors in the processes of sound production and speech generation. You should be aware that the Speech Manager's approach often differs in subtle but important ways from that of the Sound Manager. Reading the chapter "Sound Manager" in this book might help you to learn to use the Speech Manager, but it is not required.
Also, while the Speech Manager uses the Sound Manager, your application should not attempt to directly access any Sound Manager data structures used by the Speech Manager. Because the Speech Manager is likely to be a rapidly evolving portion of system software, relying on Speech Manager data structures not explicitly documented in this chapter is likely to pose compatibility problems for your application.
This chapter begins with an introduction to the speech generation process and then discusses how you can
- check for the availability of the Speech Manager
- create and dispose of speech channels
- generate speech with different voices
- obtain information about and change speech channel settings
- start and stop speech production
- synchronize speech production with other activities by using callback procedures
- embed Speech Manager commands within text to make it more understandable
- convert text into phonemes and allow the user to enter phonetic text directly
- create, install, and manipulate customized pronunciation dictionaries
Chapter Contents
- About the Speech Manager
- Voices
- Speech Attributes
- Speech Channels
- Callback Routines
- Using the Speech Manager
- Checking for Speech Manager Capabilities
- Creating, Using, and Disposing of a Speech Channel
- Working With Different Voices
- Adjusting Speech Attributes
- Pausing Speech
- Implementing Callback Procedures
- Writing Embedded Speech Commands
- Embedded Command Delimiters
- Syntax of Embedded Speech Commands
- Examples of Embedded Speech Commands
- Phonemic Representation of Speech
- Phonemic Symbols
- Prosodic Control Symbols
- Including Pronunciation Dictionaries
- Speech Manager Reference
- Constants
- Speech Information Selectors
- Data Structures
- Voice Specification Records
- Voice Description Records
- Voice File Information Records
- Speech Status Information Records
- Speech Error Information Records
- Speech Version Information Records
- Phoneme Information Records
- Phoneme Descriptor Records
- Speech Extension Data Records
- Delimiter Information Records
- Speech Manager Routines
- Starting, Stopping, and Pausing Speech
- Obtaining Information About Voices
- Managing Speech Channels
- Obtaining Information About Speech
- Changing Speech Attributes
- Converting Text To Phonemes
- Installing a Pronunciation Dictionary
- Application-Defined Routines
- Text-Done Callback Procedure
- Speech-Done Callback Procedure
- Synchronization Callback Procedure
- Error Callback Procedure
- Phoneme Callback Procedure
- Word Callback Procedure
- Resources
- The Pronunciation Dictionary Resource
- Summary of the Speech Manager
- Pascal Summary
- Constants
- Data Structures
- Speech Manager Routines
- Application-Defined Routines
- C Summary
- Constants
- Data Types
- Speech Manager Routines
- Application-Defined Routines
- Assembly-Language Information
- Data Structures
- Trap Macros
- Result Codes