Re: [ctypes-users] Com and Sapi 4 specch engine, tts commands
Brought to you by:
theller
From: Thomas H. <th...@ct...> - 2008-07-18 20:17:19
|
FT schrieb: > > Hi! > > Has anyone here done any programming on the sapi 4.0A speech engine? > I have the sapi 5 and the pytts engines and would like to use the sapi 4 > because it has more voices. > > But found it difficult to find the commands for the connection to the > engine since microsoft has gone to 5.3 and beyond. > > It would be nice to have the connection to get it started and I do have > a working model, but it seems to say about 2 words then shut up. The when > saying something else you have to create another instance, then wait until > the second creation of it. I have no experience with sapi. But this sounds a little bit as if it could have something to do with the COM threading model. By default, comtypes initializes COM for a so called 'single threaded apartment'. Generally this requires that your application has a windows message loop running which is not the case for console applications only for Windows applications. To try this out, you can either run your code in PythonWin or IDLE and look if it makes a difference. An alternative would be to call the comtypes.client.PumpEvents() function after you have started your voice (the voice is running async I assume?) Also you could post a test script and I can look into it. Thomas |