Problem with win32ole, sapi5

D

Daniel Berger

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top