Skip to main content

play

Play file(s), ringtones, speech or silence.

Parameters

NameTypeDescription
urls (or url)string | string[]URL or array of URLs to play. Required. Allowed URLs are:
  • http:// - audio file to GET
  • https:// - audio file to GET
  • ring:[duration:]<country code> - ring tone to play. For example: ring:us to play single ring or ring:20.0:us to play ring for 20 seconds.
  • say:<text to speak> - Sentence to say
  • silence:<duration> - seconds of silence to play
volumenumberOptional volume gain to apply to played URLs. Allowed values from -40.0 to 40.0. Default 0.
say_voicestringOptional voice to use with say: for text to speech. Default is Polly.Salli.
say_languagestringOptional language to use with say: for text to speech. Default is en-US.
say_genderstringOptional gender to use with say: for text to speech. Default is female.

Variables

Read by the method:

  • say_voice: (in) - Optional voice to use for text to speech.
  • say_language: (in) - Optional language to use for text to speech.
  • say_gender: (in) - Optional gender to use for text to speech.

Possible Values of Voice, Language and Ringtone

The following voice, language and ringtone values are permitted.

The ml variant stands for the multilingual version.

Supported Voices and Languages

To learn more about the supported voices and languages, please visit the Supported Voices and Languages Documentation.

Supported Ring tones

Parameter
urls.ringAvailable values are the following
ISO 3166-1 alpha-2 country codes: at, au, bg, br,
be, ch, cl, cn, cz, de, dk, ee, es, fi, fr, gr, hu, il, in,
it, lt, jp, mx, my, nl, no, nz, ph, pl, pt, ru, se, sg, th,
uk, us, us-old, tw, ve, za.

Examples

Playing a single URL

version: 1.0.0
sections:
main:
- play: https://example.com/file.mp3

Playing multiple URLs

version: 1.0.0
sections:
main:
- play:
- https://example.com/file1.wav
- https://example.com/file2.wav
- say:this is something to say
- silence:3.0
- ring:10.0:us

Playing multiple URLs with volume adjusted

version: 1.0.0
sections:
main:
- play:
volume: 30
urls:
- https://example.com/file1.wav
- https://example.com/file2.wav
- say:this is something to say
- silence:3.0
- ring:10.0:us