Class: Motion::Speech::Utterance

Inherits:
AVSpeechUtterance
  • Object
show all
Defined in:
lib/motion/speech/utterance.rb

Instance Method Summary collapse

Constructor Details

#initialize(speakable, options = {}) ⇒ Utterance

Returns a new instance of Utterance.



5
6
7
8
9
10
11
# File 'lib/motion/speech/utterance.rb', line 5

def initialize(speakable, options={})
  self.message = speakable
  self.rate = options.fetch(:rate, 0.15)
  self.pitch = options.fetch(:pitch, 1.0)
  self.voice = options.fetch(:voice, nil)
  self.volume = options.fetch(:volume, 1.0)
end

Instance Method Details

#setRate(multiplier) ⇒ Object Also known as: rate=



17
18
19
# File 'lib/motion/speech/utterance.rb', line 17

def setRate(multiplier)
  super rate_for_symbol_or_float(multiplier)
end

#setSpeechString(speakable) ⇒ Object Also known as: message=



13
14
15
# File 'lib/motion/speech/utterance.rb', line 13

def setSpeechString(speakable)
  super string_from_speakable(speakable)
end