Sha256: 7be47bb823093c213dd73383e926508d81f64c8e00566be04ea16caa77143735

Contents?: true

Size: 672 Bytes

Versions: 4

Compression:

Stored size: 672 Bytes

Contents

# encoding: utf-8

module Punchblock
  module Translator
    class Freeswitch
      module Component
        class TTSOutput < AbstractOutput
          private

          def do_output(engine, default_voice = nil)
            op = current_actor
            register_handler :es, :event_name => 'CHANNEL_EXECUTE_COMPLETE' do |event|
              op.async.send_complete_event success_reason
            end
            voice = @component_node.voice || default_voice || 'kal'
            application :speak, [engine, voice, document].join('|')
          end

          def document
            @component_node.ssml.to_s
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
punchblock-1.9.1 lib/punchblock/translator/freeswitch/component/tts_output.rb
punchblock-1.9.0 lib/punchblock/translator/freeswitch/component/tts_output.rb
punchblock-1.8.2 lib/punchblock/translator/freeswitch/component/tts_output.rb
punchblock-1.8.1 lib/punchblock/translator/freeswitch/component/tts_output.rb