Go to the documentation of this file.
24 #include "../src/porcupine_recognizer.h"
27 {
"model_path", required_argument,
NULL,
'm' },
28 {
"keyword_path", required_argument,
NULL,
'k' },
29 {
"access_key", required_argument,
NULL,
'a' },
30 {
"sensitivity", required_argument,
NULL,
's' },
53 parameters.
keywords_ = { {
"keyword", std::string(optarg) } };
68 fprintf(stderr,
"Usage : %s -m MODEL_PATH -k KEYWORD_PATH -a ACCESS_KEY [-s SENSTIVITY]\n",
argv[0]);
73 recognizer.
initialize(
"/tmp/picovoice_driver/test_porcupine", 5.);
76 std::cout <<
"Configure with parameters " << parameters << std::endl;
83 std::this_thread::sleep_for(std::chrono::milliseconds(10));
87 std::cout <<
"Result: " << recognizer.
getResult() << std::endl;
91 std::cout <<
"--" << std::endl;
std::string model_path_
model_path_ Path to the Picovoice model parameters
static struct option long_options[]
PorcupineRecognizerData::Result getResult() override
getResult Get the recognition result
void interrupt_handler(int)
bool isRecognizing()
isRecognizing Whether the recognize method is running
int main(int argc, char **argv)
std::map< std::string, std::string > keywords_
keywords_ Map from a keyword names to a keyword.ppn paths
void configure(const PorcupineRecognizerData::Parameters ¶meters) override
double sensitivity_
sensitivity_ Recognizer sensitivity
void recognize()
recognize Recognize something from an audio input stream
bool is_understood_
is_understood_ Whether the recognizer understood a keyword
std::string access_key_
access_key_ Picovoice access key
void initialize(const std::string &record_directory, double record_timeout)
initialize Initialize the recognizer