Sha256: 457c11b77533b3889e6b4b757c45c57135a5092bb6b282263699c2bbbd5c2759
Contents?: true
Size: 581 Bytes
Versions: 7
Compression:
Stored size: 581 Bytes
Contents
#encoding: UTF-8 module Termit class SpeechSynthesizer include CanOutput delegate :display_player_error_and_quit, to: :output_manager def initialize options check_sound_player @text = options[:text] @url = Termit::UrlConstructor.new(options).url end def call response = Termit::DataFetcher.new(@url, @text).data Termit::SoundResponseHandler.new(response.body).call end private def check_sound_player unless system 'which mpg123 > /dev/null' display_player_error_and_quit end end end end
Version data entries
7 entries across 7 versions & 1 rubygems