Class: Twilio::TwiML::Say
- Defined in:
- lib/twilio-ruby/twiml/voice_response.rb
Overview
<Say> TwiML Verb
Instance Attribute Summary
Attributes inherited from TwiML
Instance Method Summary collapse
-
#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.
-
#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.
-
#initialize(message: nil, **keyword_args) {|_self| ... } ⇒ Say
constructor
A new instance of Say.
-
#lang(words, xmlLang: nil, **keyword_args) ⇒ Object
- Create a new <Lang> element words
- Words to speak xml:lang
- Specify the language keyword_args
-
additional attributes.
-
#p(words, **keyword_args) ⇒ Object
- Create a new <P> element words
- Words to speak keyword_args
-
additional attributes.
-
#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.
-
#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.
-
#s(words, **keyword_args) ⇒ Object
- Create a new <S> element words
- Words to speak keyword_args
-
additional attributes.
-
#say_as(words, interpretAs: nil, role: nil, **keyword_args) ⇒ Object
- Create a new <Say-As> element words
- Words to be interpreted interpret-as
- 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.
-
#sub(words, aliasAttribute: nil, **keyword_args) ⇒ Object
- Create a new <Sub> element words
- Words to be substituted alias
- Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation keyword_args
-
additional attributes.
-
#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.
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.
225 226 227 228 229 230 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 225 def initialize(message: nil, **keyword_args) super(**keyword_args) @name = 'Say' @value = unless .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
237 238 239 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 237 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
246 247 248 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 246 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
- xml:lang
-
Specify the language
- keyword_args
-
additional attributes
255 256 257 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 255 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
263 264 265 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 263 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
273 274 275 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 273 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
284 285 286 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 284 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
292 293 294 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 292 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
- interpret-as
-
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
302 303 304 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 302 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
- alias
-
Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation
- keyword_args
-
additional attributes
311 312 313 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 311 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
320 321 322 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 320 def w(words, role: nil, **keyword_args) append(SsmlW.new(words, role: role, **keyword_args)) end |