Text to speech using win32 and Python

703
December 03, 2017, at 3:49 PM

I created a speech recognition that gives me a string of the sentence i said, in Python, and i want the system to say it. I already have the code below, but i want to change the voice of the system.

speak = wincl.Dispatch("SAPI.SpVoice")  # Speaker
print(speak.GetVoices().Item(1).getDescription())
>> Microsoft Zira Desktop - English (United States)

With the print command, i get the result of the voice i want to select like above, but how do i set it as a default voice? I tried to use the commands below, but i get an error.

speak.Voice = speak.GetVoices().Item(1)

or

speak.Voice = speak.GetVoices('Name=Microsoft Zira Desktop - English (United States)').Item(1)

or just

speak.GetVoices('Name=Microsoft Zira Desktop - English (United States)').Item(1)

Can anyone help? Thanks in advance.

Rent Charter Buses Company
READ ALSO
How do I return variables from a function in Tkinter?

How do I return variables from a function in Tkinter?

I have been trying to make a simple dice rolling GUI where you press a button and a dice rolls and gives you the output in a labelWhen I run my code I get the error that "diceOutput" is not defined

275
How to specify in the pipfile package from custom git branch using pipfile?

How to specify in the pipfile package from custom git branch using pipfile?

It is possible to specify in Pipfile packages from custom Git repositoryBut I cannot find a comprehensive documentation on how to specify the concrete branch or a commit to be used for installation

297
Predicting availability on a bike station

Predicting availability on a bike station

I finally decided to start learning ML, to do so I am trying to predict the availability of bikes of my city's public bike sharing system

226