You speak the computer repeats. Wait for the “Parla” text to appear on the screen (and also the voice) and then speak. The pc will repeat what you said after a second and will write it too. We could create an interactive test where you have to answer verbally to the questions and maybe we will do it. You can find the code also in the github repository https://github.com/formazione/utilities.
Other posts like this:
- Tkinter interface for text to speech
- Tkinter GUI to Speak
- Tkinter interface for text to speech
- Pytextaudio – get text from image to audio
- Textaudio 1.3 – Getting text from existing image
import os import time import speech_recognition as sr from win32com.client import Dispatch """ (--------) Speak n pythonprogramming.altervista.org Repeat (-------) """ s = Dispatch("SAPI.SpVoice") r = sr.Recognizer() def speak(text): s.Speak(text) for j in range(1, 4): with sr.Microphone() as source: print("Parla") speak("Parla") audio = r.listen(source) time.sleep(1) try: text = r.recognize_google(audio) print(text) speak(text) except: print("Something's not working") text = ""
Subscribe to the newsletter for updates
Tkinter templates
My youtube channel
Twitter: @pythonprogrammi - python_pygame