


Phoneme Notifications
The callback (and message) parameters are as follows:
The union PHONEME_TAG (from ttsapi.h) defines the data format for the phoneme
part of the message. The following is included for reference, but the
definitions always should be taken from ttsapi.h.
UCHAR cThisPhoneme; // current phoneme
UCHAR cNextPhoneme; // next phoneme, if known
WORD wDuration; // duration in milliseconds
} PHONEME_MARK;
typedef union {\
PHONEME_MARK pmData;
DWORD dwData
} PHONEME_TAG
An example callback routine to show phoneme notification is as follows:
LONG lParam2,
DWORD dwInstanceParam,
UINT uiMsg)
{
PHONEME_TAG ptPhoneme; // place to put phoneme data..
ptPhoneme.dwData = lParam2;
fprintf(fpLogfil,
if (uiMsg == uiID_Index_Msg)
{
fprintf(fpLogfil,
lParam1, lParam2, dwInstanceParam);
// watch for index marks..
if (lParam2 == 1)
uiSystemState = TEXT_STARTED;
if (lParam2 == 2)
uiSystemState = TEXT_DONE
}
else if (uiMsg == uiID_Error_Msg)
{
fprintf(fpLogfil,
lParam1, lParam2, dwInstanceParam);
}
else if (uiMsg == uiID_Buffer_Msg)
{
fprintf(fpLogfil,
lParam1, lParam2, dwInstanceParam);
}
else if (uiMsg == uiID_Visual_Msg)
char szThisPhoneme[10]=
char szNextPhoneme[10]=
fprintf(fpLogfil,
lParam1, lParam2, dwInstanceParam);
// decode it..
if (ptPhoneme.pmData.cThisPhoneme ==
{
// null
strcpy (szThisPhoneme,
}
else
{
szThisPhoneme[0]=
ptPhoneme.pmData.cThisPhoneme;
szThisPhoneme[1]=
}
if (ptPhoneme.pmData.cNextPhoneme ==
{
// null
strcpy (szNextPhoneme,
}
else
{
szNextPhoneme[0]=
ptPhoneme.pmData.cThisPhoneme;
szNextPhoneme[1]=
}
fprintf(fpLogfil,
lParam1,
szThisPhoneme,
szNextPhoneme,
timeGetTime()+ptPhoneme.pmData.wDuration);
}
else
{
fprintf(fpLogfil,
dwInstanceParam);
}
fprintf(fpLogfil,
}