#pragma once #include #include #include "esp_err.h" #include "feature_params.h" typedef enum { TPL_NONE = 0, TPL_NVS, TPL_BUILTIN } tpl_source_t; esp_err_t matcher_init(void); // priority: NVS-learned > compiled-in template.h > none bool matcher_has_template(void); tpl_source_t matcher_source(void); const char *matcher_source_name(void); uint32_t matcher_frame_count(void); bool matcher_suggested_threshold(float *thr); // from template.h, if the tool computed one float matcher_score(const float fp[NUM_BANDS]); // cosine vs active template (0 if none) void matcher_get_template(float out[NUM_BANDS]); esp_err_t matcher_set_template(const float fp[NUM_BANDS], uint32_t frame_count); // -> NVS, source = NVS esp_err_t matcher_reset(void); // erase NVS template, fall back to built-in