メニュー

Say/Play Widget

Studio uses Widgets to represent various parts of Twilio's functionality that can then be stitched together in your Studio Flow to build out robust applications that require no coding on your part.

New to Twilio Studio? Check out our Getting Started guide!

The Say/Play Widget allows you to play a recorded message, dictate text to a user, or play DTMF tones on a call. Use this Widget to say or play information to the user before any subsequent action. If you want to request a user’s input after a message, use the Gather Input on Call Widget instead.

say/play widget

Required Configuration for Say/Play

The Say/Play Widget requires the following information to function properly. Say or Play Message or Digits is used to determine what action will be performed when the widget executes. Playing a message will require a URL that references the audio file. Saying a message can be configured further with the desired language and actual message contents. Playing digits will require the digits to be played as DTMF tones.

名前 概要 初期値
Say or Play Message or Digits A choice indicating whether to play a pre-recorded message, say text, or play a series of digits as DTMF tones. メッセージを読み上げる
Loops The number of times to repeat the message. The minimum value is 1, and the maximum is 99. 1

Say a Message Configuration

Select Say a Message to say text to the caller using text-to-speech. After selecting Say a Message, you will be able to configure the following values:

名前 概要
Text to Say The text to say to the caller. This can include Liquid template variables. Hello {{flow.variables.first_name}}
Language The language the message is in. Select the language from the drop down menu, or use Liquid template variables. {{widgets.say_play_1.language}}
Voice The voice to use when speaking the message. Select the voice from the drop down menu, or use Liquid template variables. {{widgets.say_play_1.voice}}

Studio does not officially support SSML, and its use in Studio Widgets is not guaranteed to be reliable.

The text-to-speech language and voice will default to whatever you have configured as the default for your account in the Twilio Console. You can update your default voice settings in the Twilio Console, under the Text-to-Speech configuration menu. You can also test different voices and messages in this section of the Console.

Play a Message Configuration

Use this option to play a recorded audio message to the caller. You can see the list of supported audio file formats in the <Play> TwiML documentation. Once you select Play a Message, you will be able to configure the following value:

名前 概要
URL of Audio File The URL of media to play https://api.twilio.com/cowbell.mp3

Twilio offers a static hosting service, Twilio Assets, which you can use to upload and store audio files.

Play Digits Configuration

Selecting Digits allows you to play DTMF tones during a call. For example, if you need to test an IVR system, you can use this feature to simulate digits being pressed to navigate through the menu options.

Include w to introduce a 0.5 second pause between DTMF tones. For example, 1w2 will tell Twilio to pause 0.5 seconds after the first DTMF tone before playing the next DTMF tone. To include a one-second pause, add ww.

Once you select Digits, you will be able to configure the following value:

名前 概要
Digits The sequence of digits to play as DTMF tones. Digits can be 0-9, #, and *. Use w in between digits to add a .5 second pause between tones. Do not include any spaces between digits. 12ww#

Say/Play Transitions

These events trigger transitions from this Widget to another Widget in your Flow. For more information on working with Studio Transitions, see the Getting Started Guide.

名前 概要
Audio Complete The message finished playing

Say/Play Variables

When the Say/Play Widget executes, it will have stored the following variables for use throughout your Studio Flow. For more information on working with variables in Studio, see the Getting Started Guide.

Find definitions and examples for these variables at the Twilio Voice: <Say> documentation.

名前 Liquid Template Language
Language {{widgets.MY_WIDGET_NAME.language}}
Voice {{widgets.MY_WIDGET_NAME.voice}}

Example: Business Hours

In the following example a user will be told that the business is open if within business hours, or if closed the information about hours of operation. You can find more information on date variables in the Liquid Template Language tutorial.

Twilio Studio Play/Say Widget Example Updated

If you would like to gather input from the user after the message is sent, you can use the Gather Input on Call Widget.

さらに詳しく

Now that you know the basics of the Say/Play Widget, you may want to dig into tutorials using it:

皆さまが何を開発されるのか、目にするのが待ちきれません!

ページを評価:

ヘルプが必要ですか?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

フィードバックくださりありがとうございます!

Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!

Refer us and get $10 in 3 simple steps!

ステップ1

Get link

Get a free personal referral link here

ステップ2:

Give $10

Your user signs up and upgrade using link

ステップ3

Get $10

1,250 free SMSes
OR 1,000 free voice mins
OR 12,000 chats
OR more