Module: Punchblock::MediaContainer

Included in:
Component::Output, MediaNode
Defined in:
lib/punchblock/media_container.rb

Instance Method Summary collapse

Instance Method Details

#inspect_attributesObject

:nodoc:



36
37
38
# File 'lib/punchblock/media_container.rb', line 36

def inspect_attributes # :nodoc:
  [:voice, :ssml] + super
end

#ssmlString

Returns the SSML document to render TTS.

Returns:

  • (String)

    the SSML document to render TTS



20
21
22
23
# File 'lib/punchblock/media_container.rb', line 20

def ssml
  node = children.first
  RubySpeech::SSML.import node if node
end

#ssml=(ssml) ⇒ Object

Parameters:

  • ssml (String)

    the SSML document to render TTS



28
29
30
31
32
33
34
# File 'lib/punchblock/media_container.rb', line 28

def ssml=(ssml)
  return unless ssml
  unless ssml.is_a?(RubySpeech::SSML::Element)
    ssml = RubySpeech::SSML.import ssml
  end
  self << ssml
end

#voiceString

Returns the TTS voice to use.

Returns:

  • (String)

    the TTS voice to use



6
7
8
# File 'lib/punchblock/media_container.rb', line 6

def voice
  read_attr :voice
end

#voice=(voice) ⇒ Object

Parameters:

  • voice (String)

    to use when rendering TTS



13
14
15
# File 'lib/punchblock/media_container.rb', line 13

def voice=(voice)
  write_attr :voice, voice
end