MLECO-2835: Remove magic number for ASR-KWS
Replaced ctx.set/get<uint32>(keywordindex) with
keyword itself as const std::string&
Change-Id: I1811d93548105d6db58e57b88675f9b41e66d914
Signed-off-by: Liam Barry <liam.barry@arm.com>
diff --git a/source/use_case/kws_asr/src/UseCaseHandler.cc b/source/use_case/kws_asr/src/UseCaseHandler.cc
index c67be22..a3ebdb1 100644
--- a/source/use_case/kws_asr/src/UseCaseHandler.cc
+++ b/source/use_case/kws_asr/src/UseCaseHandler.cc
@@ -240,7 +240,7 @@
);
/* Keyword detected. */
- if (kwsClassificationResult[0].m_labelIdx == ctx.Get<uint32_t>("keywordindex")) {
+ if (kwsClassificationResult[0].m_label == ctx.Get<const std::string&>("triggerkeyword")) {
output.asrAudioStart = inferenceWindow + kwsAudioDataWindowSize;
output.asrAudioSamples = get_audio_array_size(currentIndex) -
(audioDataSlider.NextWindowStartIndex() -