Class: Blastr::TTS::TTSImplementation

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

Direct Known Subclasses

Espeak, Festival, Say

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ TTSImplementation

Returns a new instance of TTSImplementation.



8
9
10
# File 'lib/tts/tts.rb', line 8

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/tts/tts.rb', line 6

def name
  @name
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/tts/tts.rb', line 16

def available?
  binary.empty? == false
end

#binaryObject



12
13
14
# File 'lib/tts/tts.rb', line 12

def binary
  %x[#{locate_which_binary} #{@name}].strip
end

#speak(msg) ⇒ Object



20
21
22
# File 'lib/tts/tts.rb', line 20

def speak(msg)
  %x[#{binary} "#{msg}"]
end