Skip to content
This repository was archived by the owner on Oct 14, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions Python/Text to speech using windows in feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@
python program in windows 10 for convert text to speech using windows inbuilt feature.

'''
import pyttsx3 #pip install pyttsx3

import win32com.client as wincl
speak = wincl.Dispatch("SAPI.SpVoice")
speak.Speak("Text To Speech")
#initializing the speak engine
speaker = pyttsx3.init('sapi5')
voices = speaker.getProperty('voices')
speaker.setProperty('voice', voices[1].id) # 0 for male voice and 1 for female voice

#defining the speak function
def speak(text):
speaker.say(audio)
speaker.runAndWait()

speak("Hello this code uses windows inbuilt feature to convert text to speech")


'''

This Program is contributed by https://github.com/VishankSingh
'''
This Program is not complete yet
'''