[Tutor] A SAPI Module With Pitch and Create

FT chester_lab at fltg.net
Sun Jun 22 22:58:32 CEST 2008


    I have reduced down and added a few features into the SAPI 5 speech
module I have created. You can now save and read wav files.

    The test module tests most of the features I have in it at the moment.

    I added the ability inside the Create method to set all the voice
parameters. You can change the voice, volume, rate, and pitch in the Create
method. They are dict values and just assign the values you want. Pitch and
rate are from -10 to 10 with 0 the norm. Where the volume is from 0% to 100%
but do not use the (%) symbol, just the integer number.

    The default for change is 0 for any of the values and the default voice
will be the first on the list, which is Sam if you are using the Microsoft
SAPI 5 voices.

    The names are listed in the test. So assignment depends on what you have
installed onto your machine. I have not changed any usage of eSpeak voices
to allow pitch adjustment yet. An error comes up for those voices because I
have not looked into what it wants.

    This SAPI 5 engine will at least allow you to get started and includes
the methods saving and reading a wav file.

    The wav methods are .SpeakToWav and SpeakFromWav so you could use it for
other possible things, such as web sites and games.

    Enjoy testing it. I have not played with the bookmark method yet.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Sapi5.py
URL: <http://mail.python.org/pipermail/tutor/attachments/20080622/588491e3/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Test4Sapi.py
URL: <http://mail.python.org/pipermail/tutor/attachments/20080622/588491e3/attachment-0001.txt>

More information about the Tutor mailing list