Using Text-To-Speech

Table of Contents

Using Text-To-Speech
TTS Script Variables
The Start Step
The Accept Step
The Set Contact Info Step
The First Create TTS Prompt Step
The Play Prompt Step
The Create File Document Step
The Second Create TTS Prompt Step
The Annotate Step
The Menu Step
The Terminate Step
The End Step

Using Text-To-Speech


You can use the steps of the Cisco Customer Response Applications (CRA) Editor to design scripts that take advantage of Text-To-Speech (TTS) capability.

This chapter describes the design of such as script, TTSsample.aef. This script, which is designed only as an exhibit, is not a fully functional script.

The script creates prompts based on text files that are played back as speech to callers, and provides a good example of how you can use the Set Contact Info step, the Create TTS Prompt step, the Create File Document step, and the Menu step to offer callers two menu choices, in this case based on whether the caller chooses English or Spanish.

Figure 11-1 shows the TTSsample.aef script as it appears in the Design pane of the Cisco CRA Editor window.


Figure 11-1   Design Pane of the TTSsample.aef Script


This chapter contains the following sections:

TTS Script Variables

The designer begins the TTSsample.aef script design process by using the Variable pane of the CRA Editor to define script variables.

Figure 11-2 shows the variables of the TTSsample.aef script as they appear in the Variable pane of the CRA Editor window.


Figure 11-2   Variable Pane of the TTSsample.aef Script


Table 11-1 describes all the variables used in the TTSsample.aef sample script.

Table 11-1   Descriptions of Variables in the TTSsample.aef Script

Variable Name Variable Type Value Function

welcomePrompt

Prompt

Prompt created by the first Create TTS Prompt step, which is played back by the subsequent Play Prompt step.

(See The First Create TTS Prompt Step.)

spanishPrompt

Prompt

Prompt created by the second Create TTS Prompt step, which is played by the subsequent Menu step.

(See The Second Create TTS Prompt Step.)

spanishPromptDoc

Document

null

Variable created by the Create File Document step to store a reference to the text file in order to make it available for the subsequent Create TTS Prompt.

(See The Create File Document Step.)

The Start Step

The designer begins to build the TTSsample.aef script by choosing File > New from the CRA Editor menu bar. The CRA Editor places a Start step in the Design pane of the CRA Editor window. The Start Step needs no configuration and has no customizer window.

The Accept Step

The designer continues to build the TTSsample.aef script by dragging an Accept step (from the Contact palette in the Palette pane) to the Design pane of the CRA Editor window, as shown in Figure 11-1 . The script uses an Accept step to accept a contact.

The Set Contact Info Step

The designer continues to build the TTSsample.aef script by adding a Set Contact Info step (from the Contact palette), which modifies the context information associated with a contact. In this case, the script designer sets the language context of the call to L[en_US], which is American English.

Figure 11-3 shows the configured Set Contact Info customizer window.


Figure 11-3   Configured Set Contact Info Customizer Window


The First Create TTS Prompt Step

The designer continues to build the TTSsample.aef script by adding a Create TTS Prompt step (from the Prompt palette) to create a prompt based on text that the designer enters into the customizer window of the Create TTS Prompt step.

Figure 11-4 shows the configured Create TTS Prompt Customizer window.


Figure 11-4   Configured Create TTS Prompt Customizer Window


The designer configures the Create TTS Prompt step as follows:

  • Output Prompt—welcomePrompt

The name of the prompt that this step creates.

The subsequent Play Prompt step will play this prompt.

  • Text Input—"Welcome to Company ABC"

The step converts this sentence into speech.

The designer entered the sentence into the Expression Editor, using the Expression Editor (...) button.

  • Voice Gender—Default

The step uses the default voice gender.

Voice gender can be male, female, or default, if supported by the TTS provider. If optional voice genders are not supported, the system automatically falls back to a supported voice gender.

  • Override Language (optional)—English (United States) (en_US)

The prompt will be played back in American English.


Note    Setting the Override Language option is particularly important for TTS prompts because the text entered is already in a specified language. For example, if the language associated with the call is Spanish, relying on the language of the call may result in the script trying to speak English text in Spanish.

The Play Prompt Step

The designer continues the to build the TTSsample.aef script by adding a Play Prompt step (from the Prompt palette) to play back the prompt created by the Create TTS Prompt step.

To do this, the designer chooses welcomePrompt from the Prompt drop-down menu in the Prompt tab of the Play Prompt customizer window.

Figure 11-5 shows the configured Prompt tab of the Play Prompt customizer window.


Figure 11-5   Play Prompt Customizer Window—Configured Prompt Tab


The Create File Document Step

The designer continues to build the TTSsample.aef script by adding a Create File Document step (from the Document palette) to create a document variable, spanishPromptDoc, from a text file.

The subsequent Create TTS Prompt step will then use this document variable to create a prompt in the Spanish language.

Figure 11-6 shows the configured Create File Document customizer window.


Figure 11-6   Configured Create File Document Customizer Window


The designer configures the Create File Document customizer window as follows:

  • Filename—"spanishPrompt.txt"

This filename represents the text file that holds the text that the subsequent Create TTS Prompt step will convert into speech.

  • Document—spanishPromptDoc

This document variable will be used by the subsequent Create TTS Prompt step to create a Spanish language prompt.

The Second Create TTS Prompt Step

The designer uses a second Create TTS Prompt step (from the Prompt palette) to convert the text contained in the spanishPromptDoc variable into a prompt, spanishPrompt, that the subsequent Menu step will use to offer callers the choice of the Spanish language.

Figure 11-4 shows the configured second Create TTS Prompt customizer window.


Figure 11-7   Configured Second Create TTS Prompt Customizer Window


The designer configures the second Create TTS Prompt customizer window as follows:

  • Output Prompt—spanishPrompt

The name of the prompt that this step creates and that the subsequent Menu step will play.

  • Text Input—spanishPromptDoc

The document that is the source of the text that is converted to speech.

  • Voice Gender—Default

The prompt playback uses the default voice gender.

  • Override Language (optional)—Spanish (Colombia) (es_CO)

The prompt will be played back in Colombian (American) Spanish.


Note    Make sure to specify that the prompt converts the language of the text, and not the language of the call, to speech.

The Annotate Step

The designer adds an Annotate step (from the General palette) after the second Create TTS Prompt step to insert a note describing the functionality of the subsequent Menu step.

Figure 11-8 shows the configured Annotate customizer window.


Figure 11-8   Annotate Customizer Window



Note   The Menu step itself also contains two instances of the Annotate step.

The Menu Step

The designer continues to build the TTSsample.aef script by adding a Menu step (from the Media palette) to offer the caller the choice between the English and Spanish languages.

Figure 11-9 shows the configured General tab of the Menu customizer window.


Figure 11-9   Menu Customizer Window—Configured General Tab


The designer configures the General tab of the Menu customizer window as follows:

  • Contact—Triggering Contact

The Menu step acts upon the contact that triggered the execution of the Menu step.

  • Options—English, Spanish

The Menu step offers these two menu choices to the caller.

  • Interruptible—Yes

External events can interrupt the execution of this step.

Figure 11-10 shows the configured Prompt tab of the Menu customizer window.


Figure 11-10   Menu Customizer Window—Configured Prompt Tab


The designer configures the Prompt tab of the Menu customizer window as follows:

  • Prompt—TTS["For English, press one"] + spanishPrompt

The Menu step plays this prompt back to the caller. The specified prompt expression combines the TTS prompt, "For English, press one" with spanishPrompt, which the second Create TTS Prompt step previously created. (See The Second Create TTS Prompt Step.)


Note    The format TTS[...] is another way to create a TTS prompt that uses the default gender and the language of the call. The text passed in parameter must match the language of the call.

  • Barge In—Yes

The caller can respond without having to listen to the whole playback of the prompt.

  • Continue on Prompt Errors—Yes

In the event of a prompt error, instead of generating an exception, the step continues with the second prompt if the error occurs on the first prompt, or, if this is the last prompt in the sequence, the script waits for input from the caller.

Figure 11-11 shows the configured Input Tab of the Menu customizer window.


Figure 11-11   Menu Customizer Window—Configured Input Tab


The designer configures the Input tab of the Menu customizer window as follows:

  • Timeout (in sec)—3

The system waits 3 seconds for input from the caller before sending the script to the Timeout output branch (after the script reaches the maximum number of attempts).

  • Maximum Retries—3

The Menu step will plays the prompt to the caller up to 3 times after a timeout or invalid input response.

In this case, after 3 retries, the Menu step executes either the Timeout or Unsuccessful output branches, depending on whether the last try timed out or the caller entered an invalid input response.

  • Flush Input Buffer—No

The caller can type ahead and the step will save the previous input.

In this sample script (see Figure 11-1 ), the Menu step has the following four output branches:

  • English—If this were a fully-functioning script, this output branch would contain steps providing business logic in an English language context.
  • Spanish—If this were a fully-functioning script, this output branch would contain steps providing business logic in a Spanish language context.
  • Timeout—If the script times out, the script will fall through to the closing steps of the script.
  • Unsuccessful—If valid caller response is not received, the script will fall through to the closing steps of the script.

The Terminate Step

The designer closes the sample script TTSsample.aef with a Terminate step (from the Contact palette), which ends the call.

The End Step

The designer concludes the TTSsample.aef script with an End step (from the General palette).

The End step ends the script and releases all system resources.