Class: CW::Voice

Inherits:
Object
  • Object
show all
Defined in:
lib/cw/voice.rb

Overview

class Speak speaks with a voice

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Voice

Returns a new instance of Voice.



9
10
11
# File 'lib/cw/voice.rb', line 9

def initialize(options = {})
  @options = options
end

Instance Method Details

#say(words, rate = 300, voice = 'bruce') ⇒ Object



13
14
15
16
# File 'lib/cw/voice.rb', line 13

def say words, rate = 300, voice = 'bruce'
  system("say #{words} -ospoken.wave -r#{rate} -v#{voice}")
  system("afplay spoken.wave")
end