Classes | |
class | CPorcupine |
class | PicovoiceStatuses |
Public Member Functions | |
def | __init__ (self, access_key, library_path, model_path, keyword_paths, sensitivities) |
def | delete (self) |
def | frame_length (self) |
def | process (self, pcm) |
def | sample_rate (self) |
def | version (self) |
Public Attributes | |
process_func | |
Private Attributes | |
_delete_func | |
_frame_length | |
_handle | |
_sample_rate | |
_version | |
Static Private Attributes | |
_PICOVOICE_STATUS_TO_EXCEPTION | |
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.
Definition at line 65 of file porcupine.py.
def python.porcupine.Porcupine.__init__ | ( | self, | |
access_key, | |||
library_path, | |||
model_path, | |||
keyword_paths, | |||
sensitivities | |||
) |
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.
Definition at line 104 of file porcupine.py.
def python.porcupine.Porcupine.delete | ( | self | ) |
Releases resources acquired by Porcupine.
Definition at line 177 of file porcupine.py.
def python.porcupine.Porcupine.frame_length | ( | self | ) |
Number of audio samples per frame.
Definition at line 210 of file porcupine.py.
def python.porcupine.Porcupine.process | ( | self, | |
pcm | |||
) |
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.
Definition at line 182 of file porcupine.py.
def python.porcupine.Porcupine.sample_rate | ( | self | ) |
Audio sample rate accepted by Picovoice.
Definition at line 216 of file porcupine.py.
def python.porcupine.Porcupine.version | ( | self | ) |
Version
Definition at line 204 of file porcupine.py.
|
private |
Definition at line 160 of file porcupine.py.
|
private |
Definition at line 173 of file porcupine.py.
|
private |
Definition at line 148 of file porcupine.py.
|
staticprivate |
Definition at line 87 of file porcupine.py.
|
private |
Definition at line 175 of file porcupine.py.
|
private |
Definition at line 171 of file porcupine.py.
python.porcupine.Porcupine.process_func |
Definition at line 164 of file porcupine.py.