Skip to main content
Version: v4 (Stable)

TTSMENU

TTSMENU(sTextMenu AS STRING, sWaitedDTMF AS STRING [, nRepeat AS INTEGER [, nTimeout AS INTEGER [, sErrText AS STRING [, bErrAbort AS BOOLEAN [, language AS STRING/INTEGER ]]]]]) AS INTEGER

Plays a voice menu and returns the user's DTMF choice.

The text of the menu is given by <sTextMenu>. The allowed DTMF codes are described by the string <sWaitedDTMF>. If the entered DTMF code is not in the waited DTMF list, or if no DTMF key is pressed during the <nTimeOut> delay (in seconds), the menu is repeated <nRepeat> times. For each invalid choice or each timeout, the optional error message <sErrText> will be played (if <bErrAbort> is TRUE, all other playing messages will be stopped).

The optional <language> parameter defines the language to select for text to speech, by using the language strings defined in the proposed voices of the selected engine (en-us, en-gb, fr-fr, de-de, ...) or the corresponding numeric language code (1033, 2057, 1036, 1031). If this parameter is not defined, the default selected voice is used.

The returned value depends on the pressed key: 0 to 9 for numerical keys, 10 for A, 11 for B, ..., 16 for #, 17 for *, -2 when timeout expired without key, -1 when line is hung-up, -3 if the second call of a telephony transfer is hung-up.