def __enter__(self):
    self._audio_interface = PyAudio()
    self._audio_stream = self._audio_interface.open(format=paInt16, channels=1, rate=self._rate, input=True, frames_per_buffer=self._chunk, stream_callback=self._fill_buffer)
    self.closed = False
    return self
def __enter__(self):
    self._audio_interface = PyAudio()
    self._audio_stream = self._audio_interface.open(format=paInt16, channels=1, rate=self._rate, input=True, frames_per_buffer=self._chunk, stream_callback=self._fill_buffer)
    self.closed = False
    return self