class_docstr: Asynchronously record and buffer audio using pyaudio.
  
  This class wraps the pyaudio interface. It contains a queue.Queue object to
  hold chunks of raw audio, and a callback function _enqueue_audio() which
  places raw audio into this queue. This allows the pyaudio.Stream object to
  record asynchronously at low latency.
  
  The class acts as a context manager. When entering the context it creates a
  pyaudio.Stream object and starts recording; it stops recording on exit. The
  Stream saves all of its audio to the Queue as two-tuples of
  (timestamp, raw_audio). The raw_audio is available from the queue as a numpy
  array using the get_audio() function.
  
  This class uses the term "frame" in the same sense that PortAudio does, so
  "frame" means something different here than elsewhere in the daredevil stack.
  A frame in PortAudio is one audio sample across all channels, so one frame of
  16-bit stereo audio is four bytes of data as two 16-bit integers.
code: def __enter__(self):
      if self._device_index is None:
          self._device_index = (
              self._audio.get_default_input_device_info()["index"]
          )
      kwargs = {"input_device_index": self._device_index}
      device_info = (
          self._audio.get_device_info_by_host_api_device_index(
              0, self._device_index
          )
      )
      if device_info.get("maxInputChannels") <= 0:
          raise ValueError(
              "Audio device has insufficient input channels."
          )
      print(
          "Using audio device '%s' for index %d"
          % (device_info["name"], device_info["index"])
      )
      self._stream = self._audio.open(
          format=self.pyaudio_format,
          channels=self.num_channels,
          rate=self._raw_audio_sample_rate_hz,
          input=True,
          output=False,
          frames_per_buffer=self.frames_per_chunk,
          start=True,
          stream_callback=self._enqueue_raw_audio,
          **kwargs,
      )
      logging.info("Started audio stream.")
      return self
  
imports: import importlib
  import math
  import queue
  import time
  from absl import logging
  import numpy
  import pyaudio
  import scipy
  import six
label_desc: Use image node_id 2 for calling the AudioRecorder obj's underlying member method code with example usage: obj.__enter__() and returns: self