Public Member Functions | |
def | __init__ (self, access_key, library_path, model_path, keyword_paths, sensitivities, input_device_index=None, output_path=None) |
def | run (self) |
def | show_audio_devices (cls) |
Private Attributes | |
_access_key | |
_input_device_index | |
_keyword_paths | |
_library_path | |
_model_path | |
_output_path | |
_sensitivities | |
Microphone Demo for Porcupine wake word engine. It creates an input audio stream from a microphone, monitors it, and upon detecting the specified wake word(s) prints the detection time and wake word on console. It optionally saves the recorded audio into a file for further debugging.
Definition at line 23 of file porcupine_demo_mic.py.
def porcupine_demo_mic.PorcupineDemo.__init__ | ( | self, | |
access_key, | |||
library_path, | |||
model_path, | |||
keyword_paths, | |||
sensitivities, | |||
input_device_index = None , |
|||
output_path = None |
|||
) |
Constructor. :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 set 0.5 will be used. :param input_device_index: Optional argument. If provided, audio is recorded from this input device. Otherwise, the default audio input device is used. :param output_path: If provided recorded audio will be stored in this location at the end of the run.
Definition at line 30 of file porcupine_demo_mic.py.
def porcupine_demo_mic.PorcupineDemo.run | ( | self | ) |
Creates an input audio stream, instantiates an instance of Porcupine object, and monitors the audio stream for occurrences of the wake word(s). It prints the time of detection for each occurrence and the wake word.
Definition at line 65 of file porcupine_demo_mic.py.
def porcupine_demo_mic.PorcupineDemo.show_audio_devices | ( | cls | ) |
Definition at line 151 of file porcupine_demo_mic.py.
|
private |
Definition at line 48 of file porcupine_demo_mic.py.
|
private |
Definition at line 53 of file porcupine_demo_mic.py.
|
private |
Definition at line 51 of file porcupine_demo_mic.py.
|
private |
Definition at line 49 of file porcupine_demo_mic.py.
|
private |
Definition at line 50 of file porcupine_demo_mic.py.
|
private |
Definition at line 55 of file porcupine_demo_mic.py.
|
private |
Definition at line 52 of file porcupine_demo_mic.py.