Class: Chorus

Inherits:
Object
  • Object
show all
Defined in:
lib/chorus.rb,
lib/chorus/version.rb

Constant Summary collapse

VERSION =
"0.0.2"

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Chorus

Returns a new instance of Chorus.



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/chorus.rb', line 5

def initialize(options = {})
  default_options = {:voices => ["Fred", "Kathy"]}
  _options        = default_options.merge!(options)

  _options[:voices].each_with_index do |voice, i|
    Thread.new do
      `say -v #{voice} "#{_options[:text]}"`
    end
    sleep _options[:delay] if _options[:delay] && _options[:voices].length != i+1
  end

end