Sha256: 061277f72b65a61c1267c0a49d64098a8ccfee372b15b0204e7316cf31f028ad

Contents?: true

Size: 952 Bytes

Versions: 6

Compression:

Stored size: 952 Bytes

Contents

# encoding: utf-8

require 'ruby_speech'

module Adhearsion
  class CallController
    module Output
      class AbstractPlayer

        attr_accessor :controller

        def initialize(controller)
          @controller = controller
        end

        def play_ssml(ssml, options = {})
          if [RubySpeech::SSML::Speak, Nokogiri::XML::Document].include? ssml.class
            output ssml, options
          end
        end

        def new_output(options)
          defaults = {}

          default_voice = Adhearsion.config.platform.media.default_voice || Adhearsion.config.punchblock[:default_voice]
          defaults[:voice] = default_voice if default_voice

          renderer = Adhearsion.config.platform.media.default_renderer || Adhearsion.config.punchblock[:media_engine]
          defaults[:renderer] = renderer if renderer

          Punchblock::Component::Output.new defaults.merge(options)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
adhearsion-2.5.4 lib/adhearsion/call_controller/output/abstract_player.rb
adhearsion-2.5.3 lib/adhearsion/call_controller/output/abstract_player.rb
adhearsion-2.5.2 lib/adhearsion/call_controller/output/abstract_player.rb
adhearsion-2.5.0 lib/adhearsion/call_controller/output/abstract_player.rb
adhearsion-2.4.0 lib/adhearsion/call_controller/output/abstract_player.rb
adhearsion-2.4.0.beta3 lib/adhearsion/call_controller/output/abstract_player.rb