Method: Commander::UI.speak

Defined in:
lib/commander/user_interaction.rb

.speak(message, voice = :Alex, rate = 175) ⇒ Object

Speak message using voice at a speaking rate of rate

Voice defaults to ‘Alex’, which is one of the better voices. Speaking rate defaults to 175 words per minute

Examples

speak 'What is your favorite food? '
food = ask 'favorite food?: '
speak "Wow, I like #{food} too. We have so much in common." 
speak "I like #{food} as well!", "Victoria", 190

Notes

  • MacOS only


139
140
141
# File 'lib/commander/user_interaction.rb', line 139

def speak message, voice = :Alex, rate = 175
  Thread.new { applescript "say #{message.inspect} using #{voice.to_s.inspect} speaking rate #{rate}" }
end