Class: CWG::Voice

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

Overview

class Speak speaks with a voice

Instance Method Summary (collapse)

Constructor Details

- (Voice) initialize(options = {})

Returns a new instance of Voice



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

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

Instance Method Details

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



13
14
15
16
# File '/Users/martyn/cw/cw_clone/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