Daniel Berger
3/8/2006 6:39:00 AM
Hi all,
Ruby 1.8.4 (both installer and hand built)
win32-sapi 0.1.3
Why does my attempt to set the voice fail?
C:\eclipse\workspace\win32-sapi>c:\ruby184\bin\irb
irb(main):001:0> require 'win32/sapi5'
=> true
irb(main):002:0> include Win32
=> Object
irb(main):003:0> v = SpVoice.new
=> #<Win32::SpVoice:0x2bffe70>
irb(main):004:0> hash = {}
=> {}
irb(main):005:0> v.getvoices.each{ |voice|
hash[File.basename(voice.Id)] = voice }
=> nil
irb(main):006:0> hash
=> {"MSMary"=>#<WIN32OLE:0x2bf1c20>, "MSSam"=>#<WIN32OLE:0x2bf1ce0>,
"SampleTTSVoice"=>#<WIN32OLE:0x2bf1b90>, "MSMike"=>
#<WIN32OLE:0x2bf1cb0>}
irb(main):007:0> v.voice = hash["MSMary"]
WIN32OLERuntimeError:
OLE error code:0 in <Unknown>
<No Description>
HRESULT error code:0x80020003
Member not found.
from (irb):8:in `method_missing'
from (irb):8
I also tried v.setproperty("voice",hash["MSMary"]) but got the same
result.
Any ideas?
Thanks,
Dan