Class: Termit::SpeechSynthesizer

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

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ SpeechSynthesizer

Returns a new instance of SpeechSynthesizer.



4
5
6
7
8
# File 'lib/termit/speech_synthesizer.rb', line 4

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

Instance Method Details

#callObject



10
11
12
13
# File 'lib/termit/speech_synthesizer.rb', line 10

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