Class: Termit::SpeechSynthesizer

Inherits:
Object
  • Object
show all
Includes:
CanOutput
Defined in:
lib/termit/speech_synthesizer.rb

Instance Method Summary collapse

Methods included from CanOutput

included

Constructor Details

#initialize(options) ⇒ SpeechSynthesizer

Returns a new instance of SpeechSynthesizer.



7
8
9
10
11
# File 'lib/termit/speech_synthesizer.rb', line 7

def initialize options
  check_sound_player
  @text = options[:text]
  @url = Termit::UrlConstructor.new(options).url
end

Instance Method Details

#callObject



13
14
15
16
# File 'lib/termit/speech_synthesizer.rb', line 13

def call
  response = Termit::SoundFetcher.new(@url, @text).data
  Termit::SoundResponseHandler.new(response.body).call
end