soundhound speech credential support audio endpoint (#520)

* soundhound speech credential support audio endpoint

* soundhound speech credential support audio endpoint

* wip

* wip
This commit is contained in:
Hoan Luu Huu
2025-11-29 09:47:40 +07:00
committed by GitHub
parent eb681f9ddf
commit 40754deb3e
4 changed files with 15 additions and 9 deletions

View File

@@ -166,6 +166,7 @@ const encryptCredential = (obj) => {
engine_version, engine_version,
service_version, service_version,
api_uri, api_uri,
houndify_server_uri,
options options
} = obj; } = obj;
@@ -329,7 +330,7 @@ const encryptCredential = (obj) => {
assert(client_id, 'invalid houndify speech credential: client_id is required'); assert(client_id, 'invalid houndify speech credential: client_id is required');
assert(client_key, 'invalid houndify speech credential: client_key is required'); assert(client_key, 'invalid houndify speech credential: client_key is required');
assert(user_id, 'invalid houndify speech credential: user_id is required'); assert(user_id, 'invalid houndify speech credential: user_id is required');
const houndifyData = JSON.stringify({client_id, client_key, user_id}); const houndifyData = JSON.stringify({client_id, client_key, user_id, houndify_server_uri});
return encrypt(houndifyData); return encrypt(houndifyData);
case 'voxist': case 'voxist':
@@ -557,7 +558,8 @@ router.put('/:sid', async(req, res) => {
speechmatics_stt_uri, speechmatics_stt_uri,
resemble_tts_use_tls, resemble_tts_use_tls,
resemble_tts_uri, resemble_tts_uri,
api_uri api_uri,
houndify_server_uri
} = req.body; } = req.body;
const newCred = { const newCred = {
@@ -593,7 +595,8 @@ router.put('/:sid', async(req, res) => {
speechmatics_stt_uri, speechmatics_stt_uri,
resemble_tts_uri, resemble_tts_uri,
resemble_tts_use_tls, resemble_tts_use_tls,
api_uri api_uri,
houndify_server_uri
}; };
logger.info({o, newCred}, 'updating speech credential with this new credential'); logger.info({o, newCred}, 'updating speech credential with this new credential');
obj.credential = encryptCredential(newCred); obj.credential = encryptCredential(newCred);

View File

@@ -676,8 +676,10 @@ const testHoundifyStt = async(logger, credentials) => {
requestInfo: { requestInfo: {
UserID: user_id || 'test_user', UserID: user_id || 'test_user',
Latitude: 37.388309, Latitude: 37.388309,
Longitude: -121.973968 Longitude: -121.973968,
}, },
// custom endpint is used only for feature server.
// ...(houndify_server_uri && {endpoint: houndify_server_uri}),
// Audio format configuration // Audio format configuration
sampleRate: 16000, sampleRate: 16000,
@@ -887,6 +889,7 @@ function decryptCredential(obj, credential, logger, isObscureKey = true) {
obj.client_key = isObscureKey ? obscureKey(o.client_key) : o.client_key; obj.client_key = isObscureKey ? obscureKey(o.client_key) : o.client_key;
obj.client_id = o.client_id; obj.client_id = o.client_id;
obj.user_id = o.user_id; obj.user_id = o.user_id;
obj.houndify_server_uri = o.houndify_server_uri;
} else if ('resemble' === obj.vendor) { } else if ('resemble' === obj.vendor) {
const o = JSON.parse(decrypt(credential)); const o = JSON.parse(decrypt(credential));
obj.api_key = isObscureKey ? obscureKey(o.api_key) : o.api_key; obj.api_key = isObscureKey ? obscureKey(o.api_key) : o.api_key;

8
package-lock.json generated
View File

@@ -23,7 +23,7 @@
"@jambonz/realtimedb-helpers": "^0.8.15", "@jambonz/realtimedb-helpers": "^0.8.15",
"@jambonz/speech-utils": "^0.2.26", "@jambonz/speech-utils": "^0.2.26",
"@jambonz/time-series": "^0.2.8", "@jambonz/time-series": "^0.2.8",
"@jambonz/verb-specifications": "^0.0.118", "@jambonz/verb-specifications": "^0.0.122",
"@soniox/soniox-node": "^1.2.2", "@soniox/soniox-node": "^1.2.2",
"ajv": "^8.17.1", "ajv": "^8.17.1",
"argon2": "^0.40.1", "argon2": "^0.40.1",
@@ -4346,9 +4346,9 @@
} }
}, },
"node_modules/@jambonz/verb-specifications": { "node_modules/@jambonz/verb-specifications": {
"version": "0.0.118", "version": "0.0.122",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.118.tgz", "resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.122.tgz",
"integrity": "sha512-1dGnc6TUCehjt1yGNuqh1uzk1xw9HhUm39aVUosQMHlnT0fK0ItikeJ0uttTjFastHNmPPxqJwb20wOvVGTCFg==", "integrity": "sha512-7xqaULhKFywJ2ZuyiYt77iiJwJ+8b98Zt1X4+OqZ7Cdjhfo7S6KnR66XRVJHnekXbmfVv58kB0KWUux5TG//Sw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"debug": "^4.3.4", "debug": "^4.3.4",

View File

@@ -34,7 +34,7 @@
"@jambonz/realtimedb-helpers": "^0.8.15", "@jambonz/realtimedb-helpers": "^0.8.15",
"@jambonz/speech-utils": "^0.2.26", "@jambonz/speech-utils": "^0.2.26",
"@jambonz/time-series": "^0.2.8", "@jambonz/time-series": "^0.2.8",
"@jambonz/verb-specifications": "^0.0.118", "@jambonz/verb-specifications": "^0.0.122",
"@soniox/soniox-node": "^1.2.2", "@soniox/soniox-node": "^1.2.2",
"ajv": "^8.17.1", "ajv": "^8.17.1",
"argon2": "^0.40.1", "argon2": "^0.40.1",