code: def stop_recording(self):
          
          self._stop_recording.set()
          with self._source_lock:
              self._source.stop()
          self._recording = False
docs: Stop recording from the audio source.