From: Kyle Schmitt Date: 2008-06-30T22:18:50+09:00 Subject: Re: Win32OLE and SAPI5 voice recognition problem Err, from what I see, I don't even think that's a ruby library, it kindof looks like straight win32ole stuff. I've played with this before to use sapi for TTS (opposite direction of what you're doing). The way to really get into it is to dig through the microsoft devnet docs for it. All the usable examples will be in C/C++, and there's even some useful stuff in vb, but I always found it easier to follow their c docs. http://msdn.microsoft.com/en-us/library/ms723627(VS.85).aspx Good luck :) and if you get it recognizing, I'd love to see the code, cause I've wanted to use it too, never had the time to muck with it though. --Kyle The best thing to do is to use On Mon, Jun 30, 2008 at 12:02 AM, Thomas Morgan wrote: > I stumbled across the ruby library for this while poking around for > something else in RAA, and it seemed interesting. I tried to port > something relatively simple to see if I could get it working... > > --- > > require "win32/sapi5" > include Win32 > > listener = SpSharedRecognizer.new > context = listener.CreateRecoContext() > grammar = context.CreateGrammar(1) > grammar.DictationLoad > > grammar.DictationSetState(1) > > ev = WIN32OLE_EVENT.new(context, "ISpRecoContext") > > --- > > ... And that last line is as far as it gets, with this error message: > > recotest.rb:15:in `initialize': failed to query IConnectionPoint > (RuntimeError) > HRESULT error code:0x80040200 > from recotest.rb:15:in `new' > from recotest.rb:15 > > I don't *think* more initialization is required before being able to > receive events from the object. (At least, it didn't appear to be in the > examples that I looked at.) And I don't think that's the wrong > interface, though with the way the documentation is set up it's hard to > be sure. > > In any case, there's something wrong, but I'm not sure what. Anyone have > any ideas? (Alternately, anyone have some working ruby speech > recognition code. Once I have something that works, I can start tweaking > it until I figure out what I'm doing, but without having some kind of > starting point...) > > -Morgan. > -- > Posted via http://www.ruby-forum.com/. > >