Sha256: 7ade8853fc7ed87f516a80e28458e0dec8da05ac0e40be983bc708fb853b5d83

Contents?: true

Size: 769 Bytes

Versions: 9

Compression:

Stored size: 769 Bytes

Contents

module Punchblock
  module MediaContainer
    ##
    # @return [String] the TTS voice to use
    #
    def voice
      read_attr :voice
    end

    ##
    # @param [String] voice to use when rendering TTS
    #
    def voice=(voice)
      write_attr :voice, voice
    end

    ##
    # @return [String] the SSML document to render TTS
    #
    def ssml
      node = children.first
      RubySpeech::SSML.import node if node
    end

    ##
    # @param [String] ssml the SSML document to render TTS
    #
    def ssml=(ssml)
      return unless ssml
      unless ssml.is_a?(RubySpeech::SSML::Element)
        ssml = RubySpeech::SSML.import ssml
      end
      self << ssml
    end

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
punchblock-0.9.2 lib/punchblock/media_container.rb
punchblock-0.9.1 lib/punchblock/media_container.rb
punchblock-0.9.0 lib/punchblock/media_container.rb
punchblock-0.8.4 lib/punchblock/media_container.rb
punchblock-0.8.3 lib/punchblock/media_container.rb
punchblock-0.8.2 lib/punchblock/media_container.rb
punchblock-0.8.1 lib/punchblock/media_container.rb
punchblock-0.8.0 lib/punchblock/media_container.rb
punchblock-0.7.2 lib/punchblock/media_container.rb