I am using the SpeechRecognition Python package to get the audio from the user.
import speech_recognition as sr # obtain audio from the microphone r = sr.Recogn
I think you need to read the library specifications; then, you can check that using record method instead of listen method is preferable to your application.