Class: Twilio::TwiML::Say

Inherits:
TwiML
  • Object
show all
Defined in:
lib/twilio-ruby/twiml/voice_response.rb

Overview

<Say> TwiML Verb

Instance Attribute Summary

Attributes inherited from TwiML

#name

Instance Method Summary collapse

Methods inherited from TwiML

#add_child, #add_text, #append, #comment, to_lower_camel_case, #to_s, #xml

Constructor Details

#initialize(message: nil, **keyword_args) {|_self| ... } ⇒ Say

Returns a new instance of Say.

Yields:

  • (_self)

Yield Parameters:


525
526
527
528
529
530
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 525

def initialize(message: nil, **keyword_args)
  super(**keyword_args)
  @name = 'Say'
  @value = message unless message.nil?
  yield(self) if block_given?
end

Instance Method Details

#break(strength: nil, time: nil, **keyword_args) ⇒ Object

Create a new <Break> element

strength

Set a pause based on strength

time

Set a pause to a specific length of time in seconds or milliseconds, available values: [number]s, [number]ms

keyword_args

additional attributes


537
538
539
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 537

def break(strength: nil, time: nil, **keyword_args)
  append(SsmlBreak.new(strength: strength, time: time, **keyword_args))
end

#emphasis(words, level: nil, **keyword_args) ⇒ Object

Create a new <Emphasis> element

words

Words to emphasize

level

Specify the degree of emphasis

keyword_args

additional attributes


546
547
548
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 546

def emphasis(words, level: nil, **keyword_args)
  append(SsmlEmphasis.new(words, level: level, **keyword_args))
end

#lang(words, xmlLang: nil, **keyword_args) ⇒ Object

Create a new <Lang> element

words

Words to speak

xmlLang

Specify the language

keyword_args

additional attributes


555
556
557
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 555

def lang(words, xmlLang: nil, **keyword_args)
  append(SsmlLang.new(words, xmlLang: xmlLang, **keyword_args))
end

#p(words, **keyword_args) ⇒ Object

Create a new <P> element

words

Words to speak

keyword_args

additional attributes


563
564
565
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 563

def p(words, **keyword_args)
  append(SsmlP.new(words, **keyword_args))
end

#phoneme(words, alphabet: nil, ph: nil, **keyword_args) ⇒ Object

Create a new <Phoneme> element

words

Words to speak

alphabet

Specify the phonetic alphabet

ph

Specifiy the phonetic symbols for pronunciation

keyword_args

additional attributes


573
574
575
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 573

def phoneme(words, alphabet: nil, ph: nil, **keyword_args)
  append(SsmlPhoneme.new(words, alphabet: alphabet, ph: ph, **keyword_args))
end

#prosody(words, volume: nil, rate: nil, pitch: nil, **keyword_args) ⇒ Object

Create a new <Prosody> element

words

Words to speak

volume

Specify the volume, available values: default, silent, x-soft, soft, medium, loud, x-loud, +ndB, -ndB

rate

Specify the rate, available values: x-slow, slow, medium, fast, x-fast, n%

pitch

Specify the pitch, available values: default, x-low, low, medium, high, x-high, +n%, -n%

keyword_args

additional attributes


584
585
586
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 584

def prosody(words, volume: nil, rate: nil, pitch: nil, **keyword_args)
  append(SsmlProsody.new(words, volume: volume, rate: rate, pitch: pitch, **keyword_args))
end

#s(words, **keyword_args) ⇒ Object

Create a new <S> element

words

Words to speak

keyword_args

additional attributes


592
593
594
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 592

def s(words, **keyword_args)
  append(SsmlS.new(words, **keyword_args))
end

#say_as(words, interpretAs: nil, role: nil, **keyword_args) ⇒ Object

Create a new <Say-As> element

words

Words to be interpreted

interpretAs

Specify the type of words are spoken

role

Specify the format of the date when interpret-as is set to date

keyword_args

additional attributes


602
603
604
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 602

def say_as(words, interpretAs: nil, role: nil, **keyword_args)
  append(SsmlSayAs.new(words, interpretAs: interpretAs, role: role, **keyword_args))
end

#sub(words, aliasAttribute: nil, **keyword_args) ⇒ Object

Create a new <Sub> element

words

Words to be substituted

aliasAttribute

Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation

keyword_args

additional attributes


611
612
613
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 611

def sub(words, aliasAttribute: nil, **keyword_args)
  append(SsmlSub.new(words, aliasAttribute: aliasAttribute, **keyword_args))
end

#w(words, role: nil, **keyword_args) ⇒ Object

Create a new <W> element

words

Words to speak

role

Customize the pronunciation of words by specifying the word’s part of speech or alternate meaning

keyword_args

additional attributes


620
621
622
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 620

def w(words, role: nil, **keyword_args)
  append(SsmlW.new(words, role: role, **keyword_args))
end