Is there a way to detect pauses while taking input from the microphone in python? I have a sample code that uses speech-recognition google API to convert speech to text using a microphone of the laptop, but I'm looking for a way to detect pauses in speech simultaneously.
// Code for speech to text:
import speech_recognition as sr
import pyaudio
r = sr.Recognizer()
with sr.Microphone() as source:
r.adjust_for_ambient_noise(source)
data = r.record(source, duration=20)
text = r.recognize_google(data,language='en')
print(text)