I did coding as below. however I want to know whether there is some ways to control the recording duration. I actually, want to have a program which has a start & finish buttons so that I can control to record. I know that it is like an elementary question. but I really need to solve it. help me~ how should I compensate this problem?
import speech_recognition as sr
r = sr.Recognizer()
mic = sr.Microphone()
show = input("enter text: ")
print("Read text\a")
with mic as source:
audio = r.listen(source)
print("recorded\a")
print('Result: ', r.recognize_google(audio, language='ko-KR'))