

# Create prompts in Amazon Connect
<a name="prompts"></a>

Prompts are audio files played in call flows. For example, hold music is a prompt. Amazon Connect comes with a set of prompts that you can add to your flows. Or, you can add your own recordings. 

We recommend that you align your prompts and routing policies with each other to ensure a smooth call flow for customers.

You can create and manage prompts by using the Amazon Connect admin site as described in the topics in this section. Or you can use the [Prompt actions](https://docs.aws.amazon.com/connect/latest/APIReference/prompts-api.html) documented in the *Amazon Connect API Reference Guide*. 

**Topics**
+ [How to create prompts](#howto-prompts)
+ [Supported file types](#supported-file-types-for-prompts)
+ [Maximum length for prompts](#max-length-for-prompts)
+ [Bulk upload of prompts not supported in UI, API, or CLI](#bulk-upload-prompts)
+ [Add text-to-speech to prompts in flow blocks in Amazon Polly](text-to-speech.md)
+ [Create dynamic text strings in Play prompt blocks](create-dynamic-text-strings.md)
+ [Dynamically select which prompts to play in Amazon Connect](dynamically-select-prompts.md)
+ [Set up prompts to play from an S3 bucket in Amazon Connect](setup-prompts-s3.md)
+ [Choose the text-to-speech voice and language for audio prompts in Amazon Connect](voice-for-audio-prompts.md)
+ [Use SSML tags to personalize text-to-speech in Amazon Polly](ssml-prompt.md)
+ [SSML tags in an Amazon Connect chat conversation](chat-and-ssml-tags.md)
+ [SSML tags supported by Amazon Connect](supported-ssml-tags.md)

## How to create prompts
<a name="howto-prompts"></a>

This topic explains how to use the Amazon Connect admin website to create prompts. To create prompts programmatically, see [CreatePrompt](https://docs.aws.amazon.com/connect/latest/APIReference/API_CreatePrompt.html) in the *Amazon Connect API Reference Guide*. 

1. Log in to Amazon Connect using an account that has the following security profile permission:
   + **Numbers and flows**, **Prompts - Create**

1. On the navigation menu, choose **Routing**, **Prompts**.

1. On the **Prompts** page, choose **Add prompt**.

1. On the **Add Prompt** page, enter a name for the prompt. 

1. In the **Description** box, describe the message. We recommend using this box to provide a detailed description of the prompt. It is helpful for accessibility.

1. Choose the following actions:
   + **Upload**—Select **Choose File** to upload a .wav file that you have legal permission to use. 
   + **Record**—Choose **Start recording** and speak into your microphone to record a message. Choose **Stop recording** when you're finished. You can choose **Crop** to cut sections of the recorded prompt or choose **Clear recording** to record a new prompt.

1. In the **Prompt Settings** section, enter any tags you want to use to manage the prompt. 

   For example, you may have a department that manages prompts for greetings. You can tag those prompts so users can focus on only those recordings that pertain to them. 

1. Optionally, add tags to identify, organize, search for, filter, and control who can access this prompt. For more information, see [Add tags to resources in Amazon Connect](tagging.md).

Use the filters on the **Prompts** page to filter the list of prompts by **Name**, **Description**, and **Tags**. To copy the full Amazon Resource Name (ARN) of a prompt with just one click, choose the **Copy** icon. When you [set up dynamic prompts in a flow](dynamically-select-prompts.md), you'll need to enter the full ARN of the prompt. 

![\[The prompts page, the filter options, the copy ARN option.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/prompts-filter.png)


## Supported file types
<a name="supported-file-types-for-prompts"></a>

You can upload a pre-recorded .wav file to use for your prompt, or record one in the web application.

We recommend using 8 KHz .wav files that are less than 50 MB and less than 5 minutes long. If you use higher rated audio libraries, such as 16 KHz files, Amazon Connect has to down sample them into 8 KHz samples because of PSTN limitations. This may result in low quality audio. For more information, see the following Wikipedia article: [G.711](https://en.wikipedia.org/wiki/G.711). 

## Maximum length for prompts
<a name="max-length-for-prompts"></a>

Amazon Connect supports prompts that are less than 50 MB and less than 5 minutes long. 

## Bulk upload of prompts not supported in UI, API, or CLI
<a name="bulk-upload-prompts"></a>

Currently, bulk uploading of prompts is not supported through the Amazon Connect console or programmatically using the API or CLI.

# Add text-to-speech to prompts in flow blocks in Amazon Polly
<a name="text-to-speech"></a>

You can enter text-to-speech prompts in the following flow blocks: 
+ [Get customer input](get-customer-input.md) 
+ [Loop prompts](loop-prompts.md)
+ [Play prompt](play.md)
+ [Store customer input](store-customer-input.md)

## Amazon Polly converts text-to-speech
<a name="amazon-polly-default-voice-free"></a>

To convert text-to-speech, Amazon Connect uses Amazon Polly, a service that converts text into lifelike speech using SSML. 
+ Amazon Polly default voices such as Amazon Polly Neural and Standard voices are **free**. 
+ You will be charged for using the Amazon Polly Generative voices. For more details on pricing, see the [Amazon Polly Pricing Details](https://aws.amazon.com/polly/pricing/)
+ If you are onboarded to [Next Gen Amazon Connect](https://docs.aws.amazon.com/connect/latest/adminguide/enable-nextgeneration-amazonconnect.html), the Generative voices are included as part of the Next Gen Amazon Connect pricing.
+ You are also charged for using custom voices such as unique [ Brand Voices](https://aws.amazon.com/blogs/machine-learning/build-a-unique-brand-voice-with-amazon-polly/) that are associated with your account.

## Amazon Polly best sounding voice
<a name="amazon-polly-best-sounding-voice"></a>

Amazon Polly periodically releases improved voices and speaking styles. You can choose to automatically resolve your text-to-speech to the most lifelike and natural sounding variant of a voice. For example, if your flows use Joanna, Amazon Connect automatically resolves to Joanna's conversational speaking style. 

**Note**  
If no Neural version is available, Amazon Connect defaults to the standard voice. 

**To automatically use the best sounding voice**

1. Open the Amazon Connect console at [https://console.aws.amazon.com/connect/](https://console.aws.amazon.com/connect/).

1. If prompted to login, enter your AWS account credentials.

1. Choose the name of the instance from the **Instance alias** column.  
![\[The Amazon Connect virtual contact center instances page, the instance alias.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/instance.png)

1. In the navigation pane, choose **Flows**.

1. In the Amazon Polly section, choose **Use the best available voice**.

## How to add text-to-speech
<a name="add-tts"></a>

1. In a flow, add the block that will play the prompt. For example, add a [Play prompt](play.md) block. 

1. In the **Properties**, choose **Text-to-speech**. 

1. Enter plain text. For example, the following image shows *Thank you for calling*.   
![\[A message in the text-to-speech box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-sample-tts.png)

   Or enter SSML, as shown in the following image:  
![\[A message formatted with SSML in the text-to-speech box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-sample-ssml.png)

SSML-enhanced input text gives you more control over how Amazon Connect generates speech from the text you provide. You can customize and control aspects of speech such as pronunciation, volume, and speed.

For a list of SSML tags you can use with Amazon Connect, see [SSML tags supported by Amazon Connect](supported-ssml-tags.md). 

For more information about Amazon Polly, see [Using SSML](https://docs.aws.amazon.com/polly/latest/dg/ssml.html) in the Amazon Polly Developer Guide.

# Create dynamic text strings in Play prompt blocks in Amazon Connect
<a name="create-dynamic-text-strings"></a>

Use a [Play prompt](play.md) block to use an audio file to play as a greeting or message to callers. You can also use contact attributes to specify the greeting or message delivered to callers. To use the values of a contact attribute to personalize a message for a customer, include references to stored or external contact attributes in the text-to-speech message. 

For example, if you retrieved the customer’s name from a Lambda function, and it returns values from your customer database for FirstName and LastName, you could use these attributes to say the customer’s name in the text-to-speech block by including text similar to the following:
+ Hello \$1.External.FirstName \$1.External.LastName, thank you for calling.

This message is shown in the following image of the text-to-speech box of the [Play prompt](play.md) block.

![\[A message that contains attributes in the text-to-speech box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-attribute.png)


Alternatively, you could store the attributes returned from the Lambda function using a **Set contact attributes** block, and then reference the user-defined attribute created in the text-to-speech string.

If you are referencing a user-defined attribute that was previously set as a contact attribute in the flow using the API, you can reference the attribute using the \$1.Attributes.nameOfAttribute syntax. 

For example, if the contact in question has attributes "FirstName" and "LastName" set previously, reference them as follows:
+ Hello \$1.Attributes.FirstName \$1.Attributes.LastName, thank you for calling.

## Resolution using backticks
<a name="w2aac18c29c21c23"></a>

You can also use backticks (`) to resolve keys dynamically. For example, suppose you retrieve a customer's name from a Lambda function that returns FirstName and LastName values from your customer database. If the customer's preference for which name to use is stored in \$1.Attributes.NameToPlay, you can dynamically select the appropriate name by enclosing the dynamic key in backticks (`). 
+ Hello \$1.External.['`\$1.Attributes.NameToPlay`'], thank you for calling.

# Dynamically select which prompts to play in Amazon Connect
<a name="dynamically-select-prompts"></a>

You can dynamically select which prompt to play by using an attribute.

1. Add [Set contact attributes](set-contact-attributes.md) blocks to your flow. Configure each one to play the appropriate audio prompt. For example, the first one might play the .wav file when your contact center is open. The second one might play the .wav file for when it's closed.

   The following image shows how you might configure a [Set contact attributes](set-contact-attributes.md) block. In this example, the user-defined attribute is named **CompanyWelcomeMessage**. You can name your attribute anything you want.  
![\[The properties page of the set contact attributes block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-properties-2-a-new.png)

1. In the [Play prompt](play.md) block, choose **User Defined**, and then enter the name of the attribute that you created in step 1, as shown in the following image.  
![\[The properties page of the Play prompt block.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-properties2.png)

1. Connect the [Set contact attributes](set-contact-attributes.md) blocks to the **Play prompt** block. The following example shows how it might look if you added one of each block to test how this works.   
![\[A flow with the set contact attributes block connected to the play prompt.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/play-prompt-properties-2-b.png)

# Set up prompts to play from an S3 bucket in Amazon Connect
<a name="setup-prompts-s3"></a>

When you configure prompts on the [Get customer input](get-customer-input.md), [Loop prompts](loop-prompts.md), [Play prompt](play.md), or [Store customer input](store-customer-input.md) blocks, you can choose an S3 bucket as the source location. You can store as many voice prompts as needed in an S3 bucket and access them in real time by using contact attributes. For examples, see the [Play prompt](play.md) block. 

## Requirements
<a name="format-prompts-s3"></a>
+ **Supported formats**: Amazon Connect supports .wav files to use for your prompt. You must use .wav files that are 8KHz, and mono channel audio with U-Law encoding. Otherwise, the prompt won't play correctly. You can use publicly available third-party tools to convert your .wav files to U-Law encoding. After converting the files, upload them to Amazon Connect.
+ **Size**: Amazon Connect supports prompts that are less than 50MB and less than five minutes long.
+ **For Regions that are disabled by default** (also called [opt-in](https://docs.aws.amazon.com/general/latest/gr/rande-manage.html) Regions) such as Africa (Cape Town), your bucket must be in the same Region.

## Update the S3 bucket policy
<a name="bucket-policy-prompts-s3"></a>

To allow Amazon Connect to play prompts from an S3 bucket, when you set up your S3 bucket, you must update the bucket policy to grant `connect.amazonaws.com` (the Amazon Connect service principal) permission to call `s3:ListBucket` and `s3:GetObject`. 

**To update the S3 bucket policy:**

1. Go to the Amazon S3 admin console. 

1. Choose the bucket that has your prompts.

1. Choose the **Permissions** tab.

1. In the **Bucket policy** box, choose **Edit**, and paste the following policy as your template. Replace the bucket name, Region, AWS account ID, and [instance ID](find-instance-arn.md) with your own information, and then choose **Save changes**. 

------
#### [ JSON ]

****  

   ```
   {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
           {
               "Sid": "statement1",
               "Effect": "Allow",
               "Principal": {
                   "Service": "connect.amazonaws.com"
               },
               "Action": [
                   "s3:ListBucket",
                   "s3:GetObject"
               ],
               "Resource": [
                   "arn:aws:s3:::amzn-s3-demo-bucket1",
                   "arn:aws:s3:::amzn-s3-demo-bucket1/*"
               ],
               "Condition": {
                   "StringEquals": {
                       "aws:SourceAccount": "123456789012",
                       "aws:SourceArn": "arn:aws:connect:region:123456789012:instance/instance-id"
                   }
               }
           }
       ]
   }
   ```

------

1. Encryption: Amazon Connect cannot download and play prompts from an S3 bucket if an AWS managed key is enabled on that S3 bucket. However, you can use a customer managed key to allow the Amazon Connect service principal ("connect.amazonaws.com") that enables your Amazon Connect instance to access the S3 bucket. See the following code snippet:

   ```
   {
               "Sid": "Enable Amazon Connect",
               "Effect": "Allow",
               "Principal": {
                   "Service": "connect.amazonaws.com"
               },
               "Action": "kms:decrypt",
               "Resource": [
               	"arn:aws:kms:region:account-ID:key/key-ID"
               ]
   }
   ```

   The following image shows where you place the code on the **Key policy** tab on the AWS Key Management Service console.  
![\[The KMS page where you add the key policy.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/contact-flow-prompts-s3.png)

   For information on how to find the key ID, see [Finding the key ID and key ARN](https://docs.aws.amazon.com/kms/latest/developerguide/find-cmk-id-arn.html) in the *AWS Key Management Service Developer Guide*. 

After you set up your S3 bucket with the required bucket policy, configure [Get customer input](get-customer-input.md), [Loop prompts](loop-prompts.md), [Play prompt](play.md), or [Store customer input](store-customer-input.md) to play a prompt from the bucket.

**Tip**  
For more information about S3 buckets, including examples and limitations, see the [Play prompt](play.md) block.

# Choose the text-to-speech voice and language for audio prompts in Amazon Connect
<a name="voice-for-audio-prompts"></a>

You select the text-to-speech voice and language in the [Set voice](set-voice.md) block. 

You can also use SSML in Amazon Lex bots to modify the voice used by a chat bot when interacting with your customers. For more information about using SSML in Amazon Lex bots, see [Managing Messages](https://docs.aws.amazon.com/lex/latest/dg/howitworks-manage-prompts.html#msg-prompts-response) and [Managing Conversation Context](https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#special-response) in the Amazon Lex Developer Guide.

**Tip**  
If you enter text that isn't supported for the Amazon Polly voice you are using, it won't be played. However, any other supported text in the prompt will be played. For a list of supported languages, see [Languages Supported by Amazon Polly](https://docs.aws.amazon.com/polly/latest/dg/SupportedLanguage.html).

# Use SSML tags to personalize text-to-speech in Amazon Polly
<a name="ssml-prompt"></a>

When you add a prompt to a flow, you can use SSML tags to provide a more personalized experience for your customers. SSML tags are a way to control how Amazon Polly generates speech from the text you provide.

The default setting in a flow block for interpreting text-to-speech is **Text**. To use SSML for text to speech in your flow blocks, set the **Interpret as** field to **SSML** as shown in the following image.

![\[Image of the settings for a flow block showing the Text to speech Interpret as field set to SSML.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/connect-interpret-as-ssml.png)


# SSML tags in an Amazon Connect chat conversation
<a name="chat-and-ssml-tags"></a>

If you create text-to-speech text and apply SSML tags, they won't be interpreted in a chat conversation. For example, in the following image both the text **and tags** will be printed in the chat conversation. 

![\[SSML tags in a text to speech box.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/ssml-tags-in-prompt.png)


# SSML tags supported by Amazon Connect
<a name="supported-ssml-tags"></a>

Amazon Connect supports the following SSML tags. 

**Tip**  
If you use an unsupported tag in your input text, it's automatically ignored when it's processed. 


| Tag | Use to... | 
| --- | --- | 
|  speak  |  All SSML-enhanced text must be enclosed within a pair of speak tags.  | 
|  break  |  Add a pause to your text. The maximum duration for a pause is 10 seconds.  | 
|  lang  |  Specify another language for specific words.  | 
|  mark  |  Put a custom tag within the text.  | 
|  p  |  Add a pause between paragraphs in your text.   | 
| phoneme | Make a phonetic pronunciation for specific text. | 
| prosody | Control the volume, rate, or pitch of your selected voice. | 
| s | Add a pause between lines or sentences in your text. | 
| say-as | Combine with the interpret-as attribute to tell Amazon Polly how to say certain characters, words, and numbers. | 
| sub | Combine with the alias attribute to substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation. | 
| w | Customize the pronunciation of words by specifying the word’s part of speech or alternate meaning. | 
| amazon:effect name="whispered"  | Indicate that the input text should be spoken in a whispered voice rather than as normal speech. | 

If you use an unsupported tag in your input text it is automatically ignored when it is processed. 

To learn more about the SSML tags, see [Supported SSML Tags](https://docs.aws.amazon.com/polly/latest/dg/supportedtags.html) in the Amazon Polly Developer Guide.

## Neural and Conversational Speaking Styles
<a name="neural-and-conversational-tts"></a>

For the **Joanna** and **Matthew** neural voices, in American English (en-US), you can also specify a [Newscaster speaking style](https://docs.aws.amazon.com/polly/latest/dg/ntts-speakingstyles.html).