Class: Dictation::TTS

Inherits:
Object
  • Object
show all
Defined in:
lib/dictation/tts.rb

Instance Method Summary collapse

Constructor Details

#initialize(language, voice = nil) ⇒ TTS

Returns a new instance of TTS.



3
4
5
# File 'lib/dictation/tts.rb', line 3

def initialize(language, voice = nil)
  set_language_and_voice(language, voice)
end

Instance Method Details

#speak(text) ⇒ Object



40
41
42
# File 'lib/dictation/tts.rb', line 40

def speak(text)
  system("say -v #{@voice} #{text} > /dev/null 2>&1")
end