Short Trick 2: Text to Speech Program in Python 3.9 | Arihant Gupta

Опубликовано: 09 Август 2026
на канале: Arihant Gupta
40
5

Source Code:

import pyttsx3 #pip install pyttsx3
import speech_recognition as sr #pip install speechRecognition
import time

engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
print(voices[1].id)
engine.setProperty('voice', voices[1].id)


def speak(audio):
engine.say(audio)
engine.runAndWait()

speak("The source code is in the description, go try it yourself.")
time.sleep(2)

speak("Till then good bye!")

Copy this directly in VS Code after installing the required libraries.
pyttsx3 and speech recognition


Like and Share the Video and Subscribe to my Channel.

Recorded, Edited and Uploaded Using PC.

Specs(PC):
DELL Vostro 15(3500)
Intel Core i5 11th Gen @2.4Ghz and Turbo Boost : 4.2GHz
RAM: 8GB DDR4 2666MHz
256GB NVMe SSD + 1TB 5400rpm HDD
GPU: Intel Iris Xe Graphics 4GB Shared GPU Memory