From b1089a1ae9468e95b786a7f665ab312f9a19fad6 Mon Sep 17 00:00:00 2001 From: Sam Machin Date: Sat, 2 Aug 2025 03:26:51 +0100 Subject: [PATCH] pass recogniser opts in amd to stt (#1308) --- lib/utils/amd-utils.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/utils/amd-utils.js b/lib/utils/amd-utils.js index cd47fc94..a0937a60 100644 --- a/lib/utils/amd-utils.js +++ b/lib/utils/amd-utils.js @@ -281,13 +281,17 @@ module.exports = (logger) => { /* set stt options */ logger.info(`starting amd for vendor ${vendor} and language ${language}`); - const sttOpts = amd.setChannelVarsForStt({name: TaskName.Gather}, sttCredentials, language, { - vendor, - hints, - enhancedModel: true, - altLanguages: opts.recognizer?.altLanguages || [], - initialSpeechTimeoutMs: opts.resolveTimeoutMs, - }); + /* if opts contains recognizer object use that config for stt, otherwise use defaults */ + const rOpts = opts.recognizer ? + opts.recognizer : + { + vendor, + hints, + enhancedModel: true, + altLanguages: opts.recognizer?.altLanguages || [], + initialSpeechTimeoutMs: opts.resolveTimeoutMs, + }; + const sttOpts = amd.setChannelVarsForStt({name: TaskName.Gather}, sttCredentials, language, rOpts); await ep.set(sttOpts).catch((err) => logger.info(err, 'Error setting channel variables'));