summaryrefslogtreecommitdiff
path: root/source/use_case/kws_asr/src/MainLoop.cc
diff options
context:
space:
mode:
Diffstat (limited to 'source/use_case/kws_asr/src/MainLoop.cc')
-rw-r--r--source/use_case/kws_asr/src/MainLoop.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/use_case/kws_asr/src/MainLoop.cc b/source/use_case/kws_asr/src/MainLoop.cc
index 30cb084..c7e977f 100644
--- a/source/use_case/kws_asr/src/MainLoop.cc
+++ b/source/use_case/kws_asr/src/MainLoop.cc
@@ -136,8 +136,15 @@ void main_loop(hal_platform& platform)
caseContext.Set<const std::vector <std::string>&>("asrlabels", asrLabels);
caseContext.Set<const std::vector <std::string>&>("kwslabels", kwsLabels);
- /* Index of the kws outputs we trigger ASR on. */
- caseContext.Set<uint32_t>("keywordindex", 9 );
+ /* KWS keyword that triggers ASR and associated checks */
+ std::string triggerKeyword = std::string("yes");
+ if (std::find(kwsLabels.begin(), kwsLabels.end(), triggerKeyword) != kwsLabels.end()) {
+ caseContext.Set<const std::string &>("triggerkeyword", triggerKeyword);
+ }
+ else {
+ printf_err("Selected trigger keyword not found in labels file\n");
+ return;
+ }
/* Loop. */
bool executionSuccessful = true;