class ESpeak

Public Class Methods

speak(to_speak) click to toggle source
# File lib/gaddygaddy-client/espeak.rb, line 20
def self.speak to_speak
  file_name = to_speak.to_ascii.replace_whitespace('-').gsub('/','-')
  wav_file = "/tmp/#{file_name}.wav"
  `/usr/bin/espeak -w #{wav_file} "#{to_speak}"` unless File.exist?(wav_file)
  `/usr/bin/timeout -k 20 15 /usr/bin/aplay #{wav_file}`
end