[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bgsdev::dectalkinsoftware

Title:Software implementation of DECtalk Text-to-Speech
Moderator:BGSDEV::HALLAHAN
Created:Thu Aug 12 1993
Last Modified:Mon Jun 02 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:113
Total number of notes:390

112.0. "T4.3 API Differences?" by LEADIN::ELLISON (Richard D. Ellison) Thu Feb 27 1997 16:24

I'm running on Digital UNIX (V3.2D, V4.0B)

I pulled a copy if the T4.3 kit (note 3.9) and now get some errors 
compiling my program.

The program uses in-memory synthesis and the callback (specified
to TextToSpeechStartup) to couple a text input pipe to a 8khz ulaw
output pipe.  A second program feeds data into the text input pipe
and then plays the ulaw output pipe to a phone line using Dialogic hardware.

With the new kit I get the following errors:

================================================================================
cc: Error: dtk_server.c, line 204: In this statement, "INDEX_MARK" is not 
declared.
    if (PIPEOUT > 0 && cb_type == INDEX_MARK) {
----------------------------------^
cc: Error: dtk_server.c, line 209: In this statement, "MEMORY_BUFFER" is not    
declared.
    if (cb_type != MEMORY_BUFFER) {
-------------------^
cc: Warning: dtk_server.c, line 287: In this statement, the referenced type of  
 the pointer value "dtk_speak__ttscb" is "function (unsigned int, long, long)   
 returning void", which is not compatible with "function (long, long, unsigned  
 int, unsigned int) returning void".

    mmstat = TextToSpeechStartup(&dtk__htts,
-------------^ 
*** Exit 1
Stop.
================================================================================

The following section disappeared from /usr/include/dtk/ttsapi.h:

/**********************************************************************/
/*  The follwoing definitions are used to indicate the nature         */
/*  callback that is specified in the TextToSpeechStartup call.       */
/*  The callback may be returning an index mark or it could also be   */
/*  used to return a memory buffer.                                   */
/**********************************************************************/
#define INDEX_MARK    0
#define MEMORY_BUFFER 1

The old version didn't have s full prototype for the callback function
in TextToSpeechStartup, I went by the man page description (which still reads
the same in the test 4.3 kit)

  The callback function is defined as follows:

  void AnyCallbackName  (
       DWORD param1,
       LONG  param2,
       LONG UserDefined
            )

  Where:

  Parameter          Description

  DWORD param1

                     Specifies the type of
                     callback. It is equal to
                     constant INDEX_MARK if the
                     callback is an index mark
                     callback or if it is equal
                     to the constant
                     MEMORY_BUFFER, if the
                     callback is in response to
                     a request for memory
                     buffer output from the
                     TextToSpeechSpeak() func-
                     tion.

  LONG param2

                     The values of param2
                     depend upon the type of
                     callback. If it is an
                     index mark callback, then
                     param2 is the integer
                     value specifying the index
                     number encountered. If, on
                     the other hand, it is a
                     memory buffer callback,
                     then param2 is a pointer
                     to a memory buffer.

  LONG UserDefined

                     Specifies a pointer to the
                     user- defined parameter
                     that is passed into the
                     TextToSpeechStartup call.


The new prototype does not match this, and the ttsapi.h file doesn't
really give any good clues what to expect these new parameters to do...

From the new ttsapi.h file:

MMRESULT TextToSpeechStartupEx( LPTTS_HANDLE_T * pphTTS,
                                UINT ,
                                DWORD ,
                                VOID (*DtCallbackRoutine)(LONG,
                                                          LONG,
                                                          DWORD,
                                                          UINT),
                                LONG );
#ifndef _WIN32 
MMRESULT TextToSpeechStartup( LPTTS_HANDLE_T * pphTTS,
                             UINT ,   
                             DWORD ,
                             VOID (*DtCallbackRoutine)(LONG,
                                                       LONG,
                                                       DWORD,
                                                       UINT),
                             LONG );
#else
MMRESULT TextToSpeechStartup( HWND, LPTTS_HANDLE_T *, UINT, DWORD );
#endif

------------


Did the UNIX kit get the wrong version of ttsapi.h?

I hope that I don't have to rewrite my programs to get them
to build/run with the new version.


Regards,
Rich Ellison
T.RTitleUserPersonal
Name
DateLines
112.1API differences for T4.3BGSDEV::PAGEFri Feb 28 1997 11:2052
The ttsapi header file (ttsapi.h) was modified for 4.3. The following is a 
list of changes that were made...


				Old Value		New Value
OUTPUT_TO_AF_DEVICE		01000000		no longer exists
OUTPUT_TO_MME_DEVICE		80000000		no longer exists
OWN_AUDIO_DEVICE		10000000		00000001
REPORT_OPEN_ERROR		20000000		00000002
DO_NOT_USE_AUDIO_DEVICE		40000000		80000000


INDEX_MARK (0) and MESSAGE_BUFFER (1) were replaced with 
	TTS_MSG_INDEX_MARK	1
	TTS_MSG_BUFFER		0
	TTS_MSG_STATUS		2

Since DECtalk 4.3 is meant to work the same way on UNIX as well as NT, the code
that set the INDEX_MARK and MESSAGE_BUFFER were changed. The variables were
renamed to force a recompile of any code that uses the old names since the
values were not guarenteed to mean the same thing between 4.2A and 4.3. 

The callback routine defined in the TextToSpeechStartup() function and the
TextToSpeechStartupEx() function has been changed.

The old (4.2A) callback routine was defined as...
	Callback(DWORD param1, LONG param2, LONG userDefined)
	where	param1 = Type of callback (INDEX_MARK or MEMORY_BUFFER)
		param2 = For INDEX_MARK, this would be the index mark value
			 For MEMORY_BUFFER, this would be a pointer to the      
                             memory buffer
		userDefined = Pointer to user-defined data that was passed in   
                              TestToSpeechStartup()
The new (4.3) callback routine is defined as...
	Callback(DWORD param1, LONG param2, LONG userDefined, UINT uiMsg)
	where	param1 = For TTS_MSG_STATUS, this will indicate the             
                             error/status code
		param2 = For TTS_MSG_BUFFER, this will be a pointer to the      
                             memory buffer
        		 For TTS_MSG_INDEX_MARK, this will be the index mark    
                             value
			 For TTS_MSG_STATUS, this is additional information 
			     for the error/status.
		userDefined = Pointer to user-defined data that was passed in
			      TextToSpeechStartup()
		uiMsg = TTS_MSG_BUFFER for memory buffers
			TTS_MSG_STATUS for error and status information
			TTS_MSG_INDEX_MARK for index marks



Cathy
112.2LEADIN::ELLISONRichard D. EllisonFri Feb 28 1997 13:0017
Since the DECtalk library is a shared library, what
happens when an application that hasn't been recomplied
and relinked is run on the new kit?

I tried this and didn't get any warnings or errors
when running the program -- it just did the wrong thing.

>Since DECtalk 4.3 is meant to work the same way on UNIX as well as NT, the code
>that set the INDEX_MARK and MESSAGE_BUFFER were changed. The variables were
>renamed to force a recompile of any code that uses the old names since the
>values were not guarenteed to mean the same thing between 4.2A and 4.3. 

Changing the pre-processor constants forces an application re-write 
before re-compiling (assuming that the application writer did the right thing
and didn't just hard-code a check against 0 or 1).  This doesn't force a recompile
or relink.