Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Worked with the SAPI synthesizer directly without additional libraries. Here is a short list of required code for the example, commented out line by line:
import win32com.client
# get the synthesizer COM object
speaker = win32com.client.Dispatch("Sapi.SpVoice")
# get a list of all available voices in the system
voices = speaker.GetVoices()
# here I create a list of voice names
voices_names = [voice.GetDescription() for voice in voices]
# set the required synthesizer from the list of available ones. For example, the first one with index 0
speaker.Voice = voices[0]
# set the pronunciation rate from -10 to 10
speaker.Rate = 6
# set the voice volume from 0 to 100
speaker.Volume = 100
# say the phrase
speaker.Speak('Hello.')
In his article , he described the creation of the module in more detail, well, a piece of working with SAPI is given from there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question