Is there a way to close the source without going through Context Manager

Author: sapienza88Created May 17, 2025Updated May 17, 2025

You document using the microphone through :

import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:             
    audio = r.listen(source)  

But is there a way to initiate and "close" the microphone using Python ?

Source: Uberi/speech_recognition