Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 4 - Speech Manager / Speech Manager Reference
Resources


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.

The Pronunciation Dictionary Resource

You can store a list of words and their associated pronunciations in a resource of resource type 'dict'. You can associate any number of dictionary resources with a speech channel. Before using its internal rules to pronounce a word, the Speech Manager searches the dictionary resources that your application has associated with the speech channel in a last-in, first-searched order.

Note
Because your application is responsible for loading data from a pronunciation dictionary into memory, you can, if desired, store pronunciation information in the data fork of a file rather than in the resource fork. Also, you can devise your own format in which to store pronunciation data, as long as you convert that data into the format described in this section before calling the UseDictionary function.
Figure 4-5 shows the format of a pronunciation dictionary resource.

Figure 4-5 Format of a pronunciation dictionary resource

Note
Some synthesizers might use resources (such as resources of type 'ttsd') to store their internal pronunciation dictionaries. These internal dictionaries are not necessarily in the same format as the pronunciation dictionaries described here.
To define a dictionary resource, you ordinarily use a resource of type 'dict'. Such a resource contains a pronunciation dictionary resource header, which is at the start of the resource and defines characteristics of the dictionary as a whole, and any number of pronunciation dictionary entries. Each pronunciation dictionary entry corresponds to one word and contains one or more pronunciation dictionary entry fields. Each pronunciation dictionary entry field contains one piece of information about the word being described in the entry; for example, a dictionary entry would include a field with a textual representation of the word.

The pronunciation dictionary resource header includes the following:

Immediately following the pronunciation dictionary resource header is a list of the pronunciation dictionary entries.

Figure 4-6 shows the format of a pronunciation dictionary entry.

Figure 4-6 Format of a dictionary entry in a dictionary resource

Each pronunciation dictionary entry consists of the following:

Immediately following the field count indicator are the fields themselves. Typically, a pronunciation entry always includes a field containing the word in textual format and a field containing the phonetic pronunciation of the word.

Each field within a dictionary entry has the format illustrated in Figure 4-7.

Figure 4-7 Format of a dictionary entry field

The three parts of a dictionary entry field are as follows:


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996