Go to the documentation of this file.
51 for (
const auto& kv : parameters.
keywords_)
63 throw std::runtime_error(
"Failed to initialize picovoice porcupine with parameters " +
toString(parameters) +
": " +
88 int32_t keyword_index = -1;
92 throw std::runtime_error(
"Porcupine process failed: " + std::string(
pv_status_to_string(status)));
94 if (keyword_index < 0)
100 throw std::runtime_error(
"Keyword index " + std::to_string(keyword_index) +
" out of bound for keywords " +
PV_API pv_status_t pv_porcupine_init(const char *access_key, const char *model_path, int32_t num_keywords, const char *const *keyword_paths, const float *sensitivities, pv_porcupine_t **object)
pv_porcupine_t * porcupine_
std::ostream & operator<<(std::ostream &os, const PorcupineRecognizerData::Parameters &p)
RecordSettings getRecordSettings() override
std::vector< std::string > keyword_names_
bool recognizeProcess(int16_t *frames) override
PV_API pv_status_t pv_porcupine_process(pv_porcupine_t *object, const int16_t *pcm, int32_t *keyword_index)
std::string model_path_
model_path_ Path to the Picovoice model parameters
PorcupineRecognizerData::Result getResult() override
getResult Get the recognition result
PorcupineRecognizerData::Result result_
std::vector< const char * > keyword_paths_
PV_API int32_t pv_porcupine_frame_length(void)
std::vector< float > keyword_sensitivities_
PV_API void pv_porcupine_delete(pv_porcupine_t *object)
PV_API int32_t pv_sample_rate(void)
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
std::string toString(const T &v)
bool is_understood_
is_understood_ Whether the recognizer understood a keyword
const PV_API char * pv_status_to_string(pv_status_t status)
std::string keyword_name_
keyword_name_ Detected keyword name
std::string access_key_
access_key_ Picovoice access key
void recognizeInit() override