Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 4 - Speech Manager / Speech Manager Reference
Speech Manager Routines / Installing a Pronunciation Dictionary


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.

UseDictionary

You can use the UseDictionary function to install a designated dictionary into a speech channel.

FUNCTION UseDictionary (chan: SpeechChannel; dictionary: Handle)
                        : OSErr;
chan
The speech channel into which a dictionary is to be installed.
dictionary
A handle to the dictionary data. This is often a handle to a resource of type 'dict'.
DESCRIPTION
The UseDictionary function attempts to install the dictionary data referenced by the dictionary parameter into the speech channel referenced by the chan parameter. The synthesizer will use whatever elements of the dictionary resource it considers useful to the speech conversion process. Some speech synthesizers might ignore certain types of dictionary entries.

After the UseDictionary function returns, your application is free to release any storage allocated for the dictionary handle. The search order for application-provided dictionaries is last-in, first-searched.

All details of how an application-provided dictionary is represented within the speech synthesizer are dependent on the specific synthesizer implementation and are private to the synthesizer.

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

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the UseDictionary function are
Trap macroSelector
_SoundDispatch$0460000C

RESULT CODES
noErr0No error
memFullErr-108Not enough memory to use new dictionary
badDictFormat-246Pronunciation dictionary format error
invalidComponentID-3000Speech channel is uninitialized or bad
SEE ALSO
For a description of the format of a pronunciation dictionary, see "The Pronunciation Dictionary Resource" on page 4-89. For a discussion of how you might manipulate a dictionary in memory, see "Including Pronunciation Dictionaries" beginning on page 4-36.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996