![]() |
||||||||||
Using Text-To-Speech
![]() |
||||||||||
Table of ContentsUsing Text-To-SpeechTTS 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-SpeechYou 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 VariablesThe 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 The Start StepThe 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 StepThe 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 StepThe 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 StepThe 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: The name of the prompt that this step creates. The subsequent Play Prompt step will play this prompt. The step converts this sentence into speech. The designer entered the sentence into the Expression Editor, using the Expression Editor (...) button. 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. The prompt will be played back in American English.
The Play Prompt StepThe 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 WindowConfigured Prompt Tab The Create File Document StepThe 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: This filename represents the text file that holds the text that the subsequent Create TTS Prompt step will convert into speech. This document variable will be used by the subsequent Create TTS Prompt step to create a Spanish language prompt. The Second Create TTS Prompt StepThe 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: The name of the prompt that this step creates and that the subsequent Menu step will play. The document that is the source of the text that is converted to speech. The prompt playback uses the default voice gender. The prompt will be played back in Colombian (American) Spanish.
The Annotate StepThe 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
The Menu StepThe 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 WindowConfigured General Tab The designer configures the General tab of the Menu customizer window as follows: The Menu step acts upon the contact that triggered the execution of the Menu step. The Menu step offers these two menu choices to the caller. 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 WindowConfigured Prompt Tab The designer configures the Prompt tab of the Menu customizer window as follows: 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.)
The caller can respond without having to listen to the whole playback of the prompt. 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 WindowConfigured Input Tab The designer configures the Input tab of the Menu customizer window as follows: 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). 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. 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:
The Terminate StepThe designer closes the sample script TTSsample.aef with a Terminate step (from the Contact palette), which ends the call. The End StepThe 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.
|
||||||||||
|
|