The usual function is Speech Recognitition, which displays what you said, but before it displays what I said, I will have to shut up for about 3 seconds and then the program will understand that I don’t say anything and output text, and for my project absolutely not suitable.
Question: Is it possible to "complete" the program by listening to the voice manually and remove this silence delay?
def command(): r = sr.Recognizer() with sr.Microphone() as source: print("Говорите") audio = r.listen(source) try: zadanie = r.recognize_google(audio, language="ru-RU").lower() print("Вы сказали: " + zadanie) except sr.UnknownValueError: talk("Я вас не поняла") zadanie = command() return zadanie