Install the gem
gem install win32-sapi
Speak some words
require "win32/sapi5"
include Win32
v = SpVoice.new
v.Speak("Shall we play a game?")
*Remember ruby is case sensitive
Other cool features:
v = SpVoice.new
v.ole_get_methods
v.Status
v.Voice
v.Rate
v.Volume
v.Priority
More info: Microsoft Documentation on SpVoice
2 comments:
Thanks!
Dear Justin
I want to chage voice character from your system.
for example " Microsoft Mike"
Please teach command.
Thank you.
Post a Comment