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: Processes a frame of the incoming audio stream and emits the detection result.
  
  :param pcm: A frame of audio samples. 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.
  :return: Index of observed keyword at the end of the current frame. Indexing is 0-based and matches the ordering
  of keyword models provided to the constructor. If no keyword is detected then it returns -1.
docstr_tok: ["Processes","a","frame","of","the","incoming","audio","stream","and","emits","the","detection","result",".",":","param","pcm",":","A","frame","of","audio","samples",".","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",".",":","return",":","Index","of","observed","keyword","at","the","end","of","the","current","frame",".","Indexing","is","0-based","and","matches","the","ordering","of","keyword","models","provided","to","the","constructor",".","If","no","keyword","is","detected","then","it","returns","-1","."]
code: def process(self, pcm: Sequence[int]) -> int:
      """
      Processes a frame of the incoming audio stream and emits the detection result.
  
      :param pcm: A frame of audio samples. 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.
      :return: Index of observed keyword at the end of the current frame. Indexing is 0-based and matches the ordering
      of keyword models provided to the constructor. If no keyword is detected then it returns -1.
      """
  
      if len(pcm) != self.frame_length:
          raise ValueError(
              "Invalid frame length. expected %d but received %d"
              % (self.frame_length, len(pcm))
          )
  
      result = c_int()
      status = self._process_func(
          self._handle, (c_short * len(pcm))(*pcm), byref(result)
      )
      if status is not self.PicovoiceStatuses.SUCCESS:
          raise self._PICOVOICE_STATUS_TO_EXCEPTION[status](
              message="Processing failed",
              message_stack=self._get_error_stack(),
          )
  
      return result.value
  
imports: import os
  from ctypes import *
  from enum import Enum
  from typing import Sequence
label_desc: Use image node_id 3 for calling the Porcupine obj's underlying member method code with example usage: obj.process(pcm) and returns: result