Problem with win32ole, sapi5

Discussion in 'Ruby' started by Daniel Berger, Mar 8, 2006.

  1. 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
    Daniel Berger, Mar 8, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Iouri Kloubakov
    Replies:
    4
    Views:
    115
    Aleksei Guzev
    Oct 13, 2003
  2. Masaki Suketa
    Replies:
    4
    Views:
    376
    Dave Burt
    Mar 27, 2006
  3. Craig Moran

    ruby/win32ole Excel Move problem

    Craig Moran, Sep 21, 2006, in forum: Ruby
    Replies:
    5
    Views:
    197
    Craig Moran
    Sep 22, 2006
  4. zxem
    Replies:
    1
    Views:
    228
  5. Vojtěch Polášek

    pythonic interface to SAPI5?

    Vojtěch Polášek, Aug 17, 2012, in forum: Python
    Replies:
    0
    Views:
    191
    Vojtěch Polášek
    Aug 17, 2012
Loading...

Share This Page