Class: FSR::App::Speak

Inherits:
Application show all
Defined in:
lib/fsr/app/speak.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Application

#app_name, #raw, #to_s

Constructor Details

- (Speak) initialize(message, opts = {})

A new instance of Speak



8
9
10
11
12
13
# File 'lib/fsr/app/speak.rb', line 8

def initialize(message, opts = {})
  # wav file you wish to play, full path 
  @message = message
  @voice = opts[:voice] || "slt"
  @engine = opts[:engine] || "flite"
end

Instance Attribute Details

- (Object) message (readonly)

Returns the value of attribute message



6
7
8
# File 'lib/fsr/app/speak.rb', line 6

def message
  @message
end

Instance Method Details

- (Object) arguments



15
16
17
# File 'lib/fsr/app/speak.rb', line 15

def arguments
  [@engine, @voice, @message]
end

- (Object) sendmsg



19
20
21
# File 'lib/fsr/app/speak.rb', line 19

def sendmsg
  "call-command: execute\nexecute-app-name: %s\nexecute-app-arg: %s\nevent-lock:true\n\n" % [app_name, arguments.join("|")] 
end