Add win32com Library

Hello,

 

I'm trying to use the windows TTS in MRL but I don't know if it is possible to add the win32com library.

I've downloaded this file : http://www.java2s.com/Code/Jar/c/Downloadcommwin32all201jar.htm and put in libraries\jar folder but it didn't work.

under python 2.7 with pywin32, it's quite easy to use windows TTS :

 

import win32com.client

speaker = win32com.client.Dispatch("SAPI.SpVoice")

speaker.Speak("Hello, it works!")

 

Thanks !


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kwatters's picture

jython vs python

Hi Bretzel_59,

  So, in MRL we use "jython" as our python interpreter.  This is a java version of python that powers all of the scripting.  There are some subtle differences between python and jython.  One of which is that native library integration isn't supported in jython, so the win32com api doesn't work with jython. 

  Ok, so that being said, it sounds like what you want is to use the native TTS API in MS Windows.  I think perhaps the best way to do this is to see if you can have a command line utility that you could run to generate the speech and use jython to invoke that command line utility as it's probably going to be an up hill battle to fully support the win32com api in jython.

  Hope this helps,

    -Kevin

dom14's picture

I found

I found this: http://jampal.sourceforge.net/ptts.html

with ptts -u namefile , work with microsoft text to speesh

 

 

Bretzel_59's picture

Great !

Thanks Kevin.

 

Dom has found Jampal, a TTS program accessible with command line.

 

Really easy to use it in MRL :

Thanks Dom !!!

 

Edit : (works under Linux) : For Linux or CYGWIN installations, there is a script file (ptts.sh) which provides everything here but supports many speech engines and languages. Run ptts.sh --help to get information on it. Note that under Linux the Microsoft speech engine will not work, another speech engine must be installed.