support jambonz transcribe sampling rate (#847)

* support jambonz transcribe sampling rate

* fix review comment

* update verb specification version
This commit is contained in:
Hoan Luu Huu
2024-08-07 21:39:58 +07:00
committed by GitHub
parent f90fcdf57b
commit ed7e036890
3 changed files with 11 additions and 9 deletions

View File

@@ -837,6 +837,7 @@ module.exports = (logger) => {
};
} else if (vendor.startsWith('custom:')) {
let {options = {}} = rOpts;
const {sampleRate} = rOpts.customOptions || {};
const {auth_token, custom_stt_url} = sttCredentials;
options = {
...options,
@@ -846,12 +847,12 @@ module.exports = (logger) => {
{hints: JSON.stringify(rOpts.hints)}),
...(typeof rOpts.hintsBoost === 'number' && {hintsBoost: rOpts.hintsBoost})
};
opts = {
...opts,
...(auth_token && {JAMBONZ_STT_API_KEY: auth_token}),
JAMBONZ_STT_URL: custom_stt_url,
...(Object.keys(options).length > 0 && {JAMBONZ_STT_OPTIONS: JSON.stringify(options)}),
...(sampleRate && {JAMBONZ_STT_SAMPLING: sampleRate})
};
}