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 theUseDictionary
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
TheUseDictionary
function attempts to install the dictionary data referenced by thedictionary
parameter into the speech channel referenced by thechan
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 theUseDictionary
function might move memory, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theUseDictionary
function are
Trap macro Selector _SoundDispatch
$0460000C RESULT CODES
noErr 0 No error memFullErr -108 Not enough memory to use new dictionary badDictFormat -246 Pronunciation dictionary format error invalidComponentID -3000 Speech 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.