Show TOC Start of Content Area

Background documentation Creating Complex Prompts  Locate the document in its SAP Library structure

Use

You can create very simple or highly dynamic and adaptive prompts using the Speak element, which thus provides you with flexibility in how simple or complex utterances are spoken for the caller.

Prerecorded Prompts

If your application uses prerecorded prompts, these prompt files need to be recorded and placed in a location that is accessible to the voice gateway and which matches the Resource Targets defined in the voice application.

Using the Speak Element

A Speak element can contain any number of Speak Items of the following types:

      Audio

This type plays a pre-recorded prompt file.

      Text

This type renders some text using the test-to-speech engine on the voice gateway.

      SpeakAs

This type speaks a data value using the SAP library of prerecorded prompts.

      Break

This type adds a pause in the output.

Any of these types can use expressions to define what is being spoken. Moreover, each can have a guard-condition expression. which, if it evaluates to false, will suppress the execution of that Speak Item.

To model a Speak element, simply add one using the Add (+) icon and configure each of its items appropriately.

Example

Here is an example of a dynamic utterance using audio prompts:

      Your payroll deposit to <your_bank> was rejected on <date>. The reason given was <reason>.

      Your payroll deposit to <your_bank> was completed on <date>.

This example assumes that you have the following variables defined in your application:

Variable

Type

Comment

deposit_OK

Boolean

Indicates whether deposit succeeded

bank_code

String

Key to identify bank

bank_name

String

Friendly name of bank

deposit_date

Date

Date of deposit attempt

failure_message

String

Message returned from a failed deposit

It is also assumed that all of the bank names that are configured into your back-end system have been recorded as audio files, with a filename in the form bank_<bank_code>.wav. The failure messages have not been recorded and will be spoken as text to speech.

The following table shows the Speak Items required to produce this output. Note how the condition is used to selectively activate or deactivate parts of the utterance based on the result.

Type

Text or Value

Filename or Type

Condition

Target

Audio

Your payroll deposit to

your_payroll

-

prompts

Audio

=@bank_name

="bank_" &  @bank_code

-

prompts_banks

Audio

was completed on

was_completed_on

=@depositOK

prompts

Audio

was rejected on

was_rejected_on

=!@depositOK

prompts

SpeakAs

=@deposit_date

type=Date

-

prompts_speakas

Break

200ms

-

=!@depositOK

-

Audio

The reason given was

reason_given_was

=!@depositOK

prompts

Text

=@failure_message

-

=!@depositOK

-

 

End of Content Area