class_docstr: Python binding for Porcupine wake word engine. It detects utterances of given keywords within an incoming stream of
  audio in real-time. It processes incoming audio in consecutive frames and for each frame emits the detection result.
  The number of samples per frame can be attained by calling `.frame_length`. The incoming audio needs to have a
  sample rate equal to `.sample_rate` and be 16-bit linearly-encoded. Porcupine operates on single-channel audio.
docstr: Constructor.
  
  :param access_key: AccessKey obtained from Picovoice Console.
  :param library_path: Absolute path to Porcupine's dynamic library.
  :param model_path: Absolute path to the file containing model parameters.
  :param keyword_paths: Absolute paths to keyword model files.
  :param sensitivities: Sensitivities for detecting keywords. Each value should be a number within [0, 1]. A
  higher sensitivity results in fewer misses at the cost of increasing the false alarm rate.
docstr_tok: ["Constructor",".",":","param","access_key",":","AccessKey","obtained","from","Picovoice","Console",".",":","param","library_path",":","Absolute","path","to","Porcupine","'s","dynamic","library",".",":","param","model_path",":","Absolute","path","to","the","file","containing","model","parameters",".",":","param","keyword_paths",":","Absolute","paths","to","keyword","model","files",".",":","param","sensitivities",":","Sensitivities","for","detecting","keywords",".","Each","value","should","be","a","number","within","[","0",",","1","]",".","A","higher","sensitivity","results","in","fewer","misses","at","the","cost","of","increasing","the","false","alarm","rate","."]
code: def __init__(
      self,
      access_key: str,
      library_path: str,
      model_path: str,
      keyword_paths: Sequence[str],
      sensitivities: Sequence[float],
  ):
      """
      Constructor.
  
      :param access_key: AccessKey obtained from Picovoice Console.
      :param library_path: Absolute path to Porcupine's dynamic library.
      :param model_path: Absolute path to the file containing model parameters.
      :param keyword_paths: Absolute paths to keyword model files.
      :param sensitivities: Sensitivities for detecting keywords. Each value should be a number within [0, 1]. A
      higher sensitivity results in fewer misses at the cost of increasing the false alarm rate.
      """
  
      if not access_key:
          raise ValueError("access_key should be a non-empty string.")
  
      if not os.path.exists(library_path):
          raise IOError(
              "Couldn't find Porcupine's dynamic library at '%s'."
              % library_path
          )
  
      library = cdll.LoadLibrary(library_path)
  
      if not os.path.exists(model_path):
          raise IOError(
              "Couldn't find model file at '%s'." % model_path
          )
  
      if len(keyword_paths) != len(sensitivities):
          raise ValueError(
              "Number of keywords does not match the number of sensitivities."
          )
  
      for x in keyword_paths:
          if not os.path.exists(os.path.expanduser(x)):
              raise IOError("Couldn't find keyword file at '%s'." % x)
  
      for x in sensitivities:
          if not (0 <= x <= 1):
              raise ValueError(
                  "A sensitivity value should be within [0, 1]."
              )
  
      set_sdk_func = library.pv_set_sdk
      set_sdk_func.argtypes = [c_char_p]
      set_sdk_func.restype = None
  
      set_sdk_func("python".encode("utf-8"))
  
      self._get_error_stack_func = library.pv_get_error_stack
      self._get_error_stack_func.argtypes = [
          POINTER(POINTER(c_char_p)),
          POINTER(c_int),
      ]
      self._get_error_stack_func.restype = self.PicovoiceStatuses
  
      self._free_error_stack_func = library.pv_free_error_stack
      self._free_error_stack_func.argtypes = [POINTER(c_char_p)]
      self._free_error_stack_func.restype = None
  
      init_func = library.pv_porcupine_init
      init_func.argtypes = [
          c_char_p,
          c_char_p,
          c_int,
          POINTER(c_char_p),
          POINTER(c_float),
          POINTER(POINTER(self.CPorcupine)),
      ]
      init_func.restype = self.PicovoiceStatuses
  
      self._handle = POINTER(self.CPorcupine)()
  
      status = init_func(
          access_key.encode("utf-8"),
          model_path.encode("utf-8"),
          len(keyword_paths),
          (c_char_p * len(keyword_paths))(
              *[
                  os.path.expanduser(x).encode("utf-8")
                  for x in keyword_paths
              ]
          ),
          (c_float * len(keyword_paths))(*sensitivities),
          byref(self._handle),
      )
      if status is not self.PicovoiceStatuses.SUCCESS:
          raise self._PICOVOICE_STATUS_TO_EXCEPTION[status](
              message="Initialization failed",
              message_stack=self._get_error_stack(),
          )
  
      self._delete_func = library.pv_porcupine_delete
      self._delete_func.argtypes = [POINTER(self.CPorcupine)]
      self._delete_func.restype = None
  
      self._process_func = library.pv_porcupine_process
      self._process_func.argtypes = [
          POINTER(self.CPorcupine),
          POINTER(c_short),
          POINTER(c_int),
      ]
      self._process_func.restype = self.PicovoiceStatuses
  
      version_func = library.pv_porcupine_version
      version_func.argtypes = []
      version_func.restype = c_char_p
      self._version = version_func().decode("utf-8")
  
      self._frame_length = library.pv_porcupine_frame_length()
  
      self._sample_rate = library.pv_sample_rate()
  
imports: import os
  from ctypes import *
  from enum import Enum
  from typing import Sequence
label_desc: Use image node_id 1 to create a new Porcupine object from inherited base classes: object with example: obj = Porcupine(access_key, library_path, model_path, keyword_paths, sensitivities)