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})
};
}

15
package-lock.json generated
View File

@@ -18,7 +18,7 @@
"@jambonz/speech-utils": "^0.1.13",
"@jambonz/stats-collector": "^0.1.10",
"@jambonz/time-series": "^0.2.9",
"@jambonz/verb-specifications": "^0.0.74",
"@jambonz/verb-specifications": "^0.0.75",
"@opentelemetry/api": "^1.8.0",
"@opentelemetry/exporter-jaeger": "^1.23.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.50.0",
@@ -1575,9 +1575,10 @@
}
},
"node_modules/@jambonz/verb-specifications": {
"version": "0.0.74",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.74.tgz",
"integrity": "sha512-CiO5w6wB8pILmtFkSUQ0MpKFf9kARYpkeaV1+ogOm8YPuOS5FbGTBtbNNginwdZZcX05UBwnNviPMwVqjxlIZA==",
"version": "0.0.75",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.75.tgz",
"integrity": "sha512-THM4mzhyEDfOqfE6cI4Z4aKCR9TURXUaO5gtVBfeup6p7mab+foxHoDDLZxPLhbPqYMTSI0yYzdW+wNqtE6O1Q==",
"license": "MIT",
"dependencies": {
"debug": "^4.3.4",
"pino": "^8.8.0"
@@ -10539,9 +10540,9 @@
}
},
"@jambonz/verb-specifications": {
"version": "0.0.74",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.74.tgz",
"integrity": "sha512-CiO5w6wB8pILmtFkSUQ0MpKFf9kARYpkeaV1+ogOm8YPuOS5FbGTBtbNNginwdZZcX05UBwnNviPMwVqjxlIZA==",
"version": "0.0.75",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.75.tgz",
"integrity": "sha512-THM4mzhyEDfOqfE6cI4Z4aKCR9TURXUaO5gtVBfeup6p7mab+foxHoDDLZxPLhbPqYMTSI0yYzdW+wNqtE6O1Q==",
"requires": {
"debug": "^4.3.4",
"pino": "^8.8.0"

View File

@@ -34,7 +34,7 @@
"@jambonz/speech-utils": "^0.1.13",
"@jambonz/stats-collector": "^0.1.10",
"@jambonz/time-series": "^0.2.9",
"@jambonz/verb-specifications": "^0.0.74",
"@jambonz/verb-specifications": "^0.0.75",
"@opentelemetry/api": "^1.8.0",
"@opentelemetry/exporter-jaeger": "^1.23.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.50.0",