Class: Twilio::TwiML::SsmlEmphasis
- Defined in:
- lib/twilio-ruby/twiml/voice_response.rb
Overview
Emphasizing Words in <Say>
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: nil, level: nil, **keyword_args) {|emphasis| ... } ⇒ Object
- Create a new <Emphasis> element words
- Words to emphasize level
- Specify the degree of emphasis keyword_args
-
additional attributes.
-
#initialize(words: nil, **keyword_args) {|_self| ... } ⇒ SsmlEmphasis
constructor
A new instance of SsmlEmphasis.
-
#lang(words: nil, xmlLang: nil, **keyword_args) {|lang| ... } ⇒ Object
- Create a new <Lang> element words
- Words to speak xmlLang
- Specify the language 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: nil, volume: nil, rate: nil, pitch: nil, **keyword_args) {|prosody| ... } ⇒ 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.
-
#say_as(words, interpretAs: nil, format: nil, **keyword_args) ⇒ Object
- Create a new <Say-As> element words
- Words to be interpreted interpretAs
- Specify the type of words are spoken format
- 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 aliasAttribute
- Substitute a different word (or pronunciation) for selected text such as an acronym or abbreviation keyword_args
-
additional attributes.
-
#w(words: nil, role: nil, **keyword_args) {|w| ... } ⇒ 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(words: nil, **keyword_args) {|_self| ... } ⇒ SsmlEmphasis
Returns a new instance of SsmlEmphasis.
1306 1307 1308 1309 1310 1311 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1306 def initialize(words: nil, **keyword_args) super(**keyword_args) @name = 'emphasis' @value = words unless words.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
1318 1319 1320 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1318 def break(strength: nil, time: nil, **keyword_args) append(SsmlBreak.new(strength: strength, time: time, **keyword_args)) end |
#emphasis(words: nil, level: nil, **keyword_args) {|emphasis| ... } ⇒ Object
Create a new <Emphasis> element
- words
-
Words to emphasize
- level
-
Specify the degree of emphasis
- keyword_args
-
additional attributes
1327 1328 1329 1330 1331 1332 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1327 def emphasis(words: nil, level: nil, **keyword_args) emphasis = SsmlEmphasis.new(words: words, level: level, **keyword_args) yield(emphasis) if block_given? append(emphasis) end |
#lang(words: nil, xmlLang: nil, **keyword_args) {|lang| ... } ⇒ Object
Create a new <Lang> element
- words
-
Words to speak
- xmlLang
-
Specify the language
- keyword_args
-
additional attributes
1339 1340 1341 1342 1343 1344 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1339 def lang(words: nil, xmlLang: nil, **keyword_args) lang = SsmlLang.new(words: words, xmlLang: xmlLang, **keyword_args) yield(lang) if block_given? append(lang) 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
1352 1353 1354 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1352 def phoneme(words, alphabet: nil, ph: nil, **keyword_args) append(SsmlPhoneme.new(words, alphabet: alphabet, ph: ph, **keyword_args)) end |
#prosody(words: nil, volume: nil, rate: nil, pitch: nil, **keyword_args) {|prosody| ... } ⇒ 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
1363 1364 1365 1366 1367 1368 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1363 def prosody(words: nil, volume: nil, rate: nil, pitch: nil, **keyword_args) prosody = SsmlProsody.new(words: words, volume: volume, rate: rate, pitch: pitch, **keyword_args) yield(prosody) if block_given? append(prosody) end |
#say_as(words, interpretAs: nil, format: nil, **keyword_args) ⇒ Object
Create a new <Say-As> element
- words
-
Words to be interpreted
- interpretAs
-
Specify the type of words are spoken
- format
-
Specify the format of the date when interpret-as is set to date
- keyword_args
-
additional attributes
1376 1377 1378 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1376 def say_as(words, interpretAs: nil, format: nil, **keyword_args) append(SsmlSayAs.new(words, interpretAs: interpretAs, format: format, **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
1385 1386 1387 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1385 def sub(words, aliasAttribute: nil, **keyword_args) append(SsmlSub.new(words, aliasAttribute: aliasAttribute, **keyword_args)) end |
#w(words: nil, role: nil, **keyword_args) {|w| ... } ⇒ 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
1394 1395 1396 1397 1398 1399 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1394 def w(words: nil, role: nil, **keyword_args) w = SsmlW.new(words: words, role: role, **keyword_args) yield(w) if block_given? append(w) end |