Sha256: 1ab43774b4d246b1214e13fddb2d0aeeb06e9ac95aeae84a61e33ed9194305ed

Contents?: true

Size: 695 Bytes

Versions: 6

Compression:

Stored size: 695 Bytes

Contents

# encoding: utf-8

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

          def do_output
            register_handler :es, :event_name => 'CHANNEL_EXECUTE_COMPLETE' do |event|
              send_complete_event finish_reason
            end
            voice = @component_node.voice || :kal
            application :speak, [renderer, voice, document].join('|')
          end

          def renderer
            @component_node.renderer || :flite
          end

          def document
            @component_node.render_documents.first.value.to_s
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
punchblock-2.1.1 lib/punchblock/translator/freeswitch/component/tts_output.rb
punchblock-2.1.0 lib/punchblock/translator/freeswitch/component/tts_output.rb
punchblock-2.0.2 lib/punchblock/translator/freeswitch/component/tts_output.rb
punchblock-2.0.1 lib/punchblock/translator/freeswitch/component/tts_output.rb
punchblock-2.0.0 lib/punchblock/translator/freeswitch/component/tts_output.rb
punchblock-2.0.0.beta2 lib/punchblock/translator/freeswitch/component/tts_output.rb