[python-win32] How Do You Make Your Speech or SAPI 5 Voices Portable?

FT chester_lab at fltg.net
Thu Jun 26 14:01:21 CEST 2008


Hi!

    I am a visually impaired programmer and just joined the Win32 list to
possibly learn how to make my own screen reader, thus have to learn the in's
and out's of windows. I am sending, attached, a simple version of my voice
package and 2 different test modules. Have not learned all the list
comprehension approaches, but may do so in just this simple package. For it
would come in handy in the Create method at the end of the module.

    I am asking if anyone has played with or used the built in SAPI 5
Microsoft voices and tts engine and or tried to make the voices portable so
they are not required to be installed by the user?

    I also have the eSpeak voices in and they also did not get compiled into
the py2exe package.

    I found out when sending the test to a friend the voices were not there
except the built in voices on there machine. It would be nice to bundle them
into a package so as not to have that person hunt them down. Granted they
could be placed on a CD or a web site for download, but I have not gotten
that far yet and would be nice to do it all in one.

    You can test my module and see if you like it or can use it. The only
one I have not tested yet is the bookmark method. Have not had a need for it
yet, but will soon test it. The Voice2.py is a wxpython module test and
allows you to adjust the Volume, Rate, and Pitch of the voice or voices
installed.

NOTE:
    If you do make an executable you may also after compiling the Voice2.py
get an error if you do not
have MSVcp71.dll, mfc71.dll, and gdiplus.dll copied into your setup.py file.
In other words a copy command to
copy the dll's from your system32 folder. For if you do not, some computers
it
is run on will fail if they do not have those dll's installed. It would
appear
that they are not automatically copied.

    I am assuming that most of you probably have all the C dll's and such
and may not need the note, but those who do not will need the dll's.

#FORCE THE NEEDED DLL'S OR COMMENT THEM OUT!
shutil.copy("c:/windows/system32/msvcp71.dll", os.path.join(os.getcwd(),
"dist",
"msvcp71.dll"))
shutil.copy("c:/windows/system32/msvcp71.dll", os.path.join(os.getcwd(),
"dist",
"mfc71.dll"))
shutil.copy("c:/windows/system32/msvcp71.dll", os.path.join(os.getcwd(),
"dist",
"gdiplus.dll"))

    I hope someone has tried to make a portable voice package, but knowing
that more than 95% of programmers are sighted a may have to search a lot.
But if anyone knows how please let me know.

        Bruce
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Sapi5.py
URL: <http://mail.python.org/pipermail/python-win32/attachments/20080626/fecfa0cb/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Voice2.py
URL: <http://mail.python.org/pipermail/python-win32/attachments/20080626/fecfa0cb/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TestSapi.py
URL: <http://mail.python.org/pipermail/python-win32/attachments/20080626/fecfa0cb/attachment-0002.txt>


More information about the python-win32 mailing list