# Callback Routines and Window Procedures

After TextToSpeechSpeak is called, the text-to-speech system can notify the calling application in one of two ways. On UNIX, the information can be sent back through the callback routine defined in the startup function. On Windows, the information is passed back through window messages or callback routines, depending on which startup function was called. See the DECtalk Software API Calls for more information on startup functions.

Callback routines should not call TextToSpeech… calls. If callback routines call TextToSpeech… calls, an application crash may occur in the application calling DECtalk Software.

Both the window procedures and the callback routines have a message type and the WPARAM and the LPARM parameters. Three message types are defined:

· one for error and status messages

· one for index marks

· one to return memory buffers when using the TextToSpeechOpenInMemory call

Based on the message type, the WPARAM and the LPARAM parameters contain specific information.