From f30aeb876ae5bfcd1c60db536f8de9f75d2f8d06 Mon Sep 17 00:00:00 2001 From: Rabisha <72162430+rabi-1@users.noreply.github.com> Date: Sun, 23 Oct 2022 15:46:13 +0530 Subject: [PATCH] Create Text to speech --- Text to speech | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Text to speech diff --git a/Text to speech b/Text to speech new file mode 100644 index 0000000..d079b8f --- /dev/null +++ b/Text to speech @@ -0,0 +1,12 @@ +import pyttsx3 + +engine = pyttsx3.init("sapi5") +voices = engine.getProperty('voices') +engine.setProperty('voice',voices[0].id) + +answer = open("sample.txt") +x = answer.read() + +engine.say(x) + +engine.runAndWait()