mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
ibm speech fix
This commit is contained in:
@@ -578,7 +578,10 @@ class CallSession extends Emitter {
|
|||||||
else if ('ibm' === vendor) {
|
else if ('ibm' === vendor) {
|
||||||
return {
|
return {
|
||||||
speech_credential_sid: credential.speech_credential_sid,
|
speech_credential_sid: credential.speech_credential_sid,
|
||||||
api_key: credential.api_key
|
tts_api_key: credential.tts_api_key,
|
||||||
|
tts_region: credential.tts_region,
|
||||||
|
stt_api_key: credential.stt_api_key,
|
||||||
|
stt_region: credential.stt_region
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ class TaskSay extends Task {
|
|||||||
const salt = cs.callSid;
|
const salt = cs.callSid;
|
||||||
const credentials = cs.getSpeechCredentials(vendor, 'tts');
|
const credentials = cs.getSpeechCredentials(vendor, 'tts');
|
||||||
|
|
||||||
/* parse Nuance voces into name and model */
|
/* parse Nuance voices into name and model */
|
||||||
let model;
|
let model;
|
||||||
if (vendor === 'nuance' && voice) {
|
if (vendor === 'nuance' && voice) {
|
||||||
const arr = /([A-Za-z-]*)\s+-\s+(enhanced|standard)/.exec(voice);
|
const arr = /([A-Za-z-]*)\s+-\s+(enhanced|standard)/.exec(voice);
|
||||||
|
|||||||
@@ -51,6 +51,13 @@ const speechMapper = (cred) => {
|
|||||||
obj.client_id = o.client_id;
|
obj.client_id = o.client_id;
|
||||||
obj.secret = o.secret;
|
obj.secret = o.secret;
|
||||||
}
|
}
|
||||||
|
else if ('ibm' === obj.vendor) {
|
||||||
|
const o = JSON.parse(decrypt(credential));
|
||||||
|
obj.tts_api_key = o.tts_api_key;
|
||||||
|
obj.tts_region = o.tts_region;
|
||||||
|
obj.stt_api_key = o.stt_api_key;
|
||||||
|
obj.stt_region = o.stt_region;
|
||||||
|
}
|
||||||
else if ('deepgram' === obj.vendor) {
|
else if ('deepgram' === obj.vendor) {
|
||||||
const o = JSON.parse(decrypt(credential));
|
const o = JSON.parse(decrypt(credential));
|
||||||
obj.api_key = o.api_key;
|
obj.api_key = o.api_key;
|
||||||
@@ -79,6 +86,7 @@ module.exports = (logger, srf) => {
|
|||||||
const haveWellsaid = speech.find((s) => s.vendor === 'wellsaid');
|
const haveWellsaid = speech.find((s) => s.vendor === 'wellsaid');
|
||||||
const haveNuance = speech.find((s) => s.vendor === 'nuance');
|
const haveNuance = speech.find((s) => s.vendor === 'nuance');
|
||||||
const haveDeepgram = speech.find((s) => s.vendor === 'deepgram');
|
const haveDeepgram = speech.find((s) => s.vendor === 'deepgram');
|
||||||
|
const haveIbm = speech.find((s) => s.vendor === 'ibm');
|
||||||
if (!haveGoogle || !haveAws || !haveMicrosoft || !haveWellsaid || !haveNuance) {
|
if (!haveGoogle || !haveAws || !haveMicrosoft || !haveWellsaid || !haveNuance) {
|
||||||
const [r3] = await pp.query(sqlSpeechCredentialsForSP, account_sid);
|
const [r3] = await pp.query(sqlSpeechCredentialsForSP, account_sid);
|
||||||
if (r3.length) {
|
if (r3.length) {
|
||||||
@@ -106,6 +114,10 @@ module.exports = (logger, srf) => {
|
|||||||
const deepgram = r3.find((s) => s.vendor === 'deepgram');
|
const deepgram = r3.find((s) => s.vendor === 'deepgram');
|
||||||
if (deepgram) speech.push(speechMapper(deepgram));
|
if (deepgram) speech.push(speechMapper(deepgram));
|
||||||
}
|
}
|
||||||
|
if (!haveIbm) {
|
||||||
|
const ibm = r3.find((s) => s.vendor === 'ibm');
|
||||||
|
if (ibm) speech.push(speechMapper(ibm));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
30
package-lock.json
generated
30
package-lock.json
generated
@@ -11,7 +11,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jambonz/db-helpers": "^0.7.3",
|
"@jambonz/db-helpers": "^0.7.3",
|
||||||
"@jambonz/http-health-check": "^0.0.1",
|
"@jambonz/http-health-check": "^0.0.1",
|
||||||
"@jambonz/realtimedb-helpers": "^0.6.1",
|
"@jambonz/realtimedb-helpers": "^0.6.2",
|
||||||
"@jambonz/stats-collector": "^0.1.6",
|
"@jambonz/stats-collector": "^0.1.6",
|
||||||
"@jambonz/time-series": "^0.2.5",
|
"@jambonz/time-series": "^0.2.5",
|
||||||
"@opentelemetry/api": "^1.2.0",
|
"@opentelemetry/api": "^1.2.0",
|
||||||
@@ -539,9 +539,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@jambonz/realtimedb-helpers": {
|
"node_modules/@jambonz/realtimedb-helpers": {
|
||||||
"version": "0.6.1",
|
"version": "0.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.6.2.tgz",
|
||||||
"integrity": "sha512-R+MYjgRH59ZLSfwaPC/iNgFMS4G1TECD95CNoAO6n7uVQMADOQPiecpBBRrXEp2aJvPvLqKcsGZbivCTO9p1Ew==",
|
"integrity": "sha512-hZNjEFGtMg5Rvn50P64qvTBZpN12iXML9rNJ83JxNk6eCznavhhJ/aw0K6ouetQ+wesvN22/RSk0I5HhAvVlbA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@google-cloud/text-to-speech": "^4.0.3",
|
"@google-cloud/text-to-speech": "^4.0.3",
|
||||||
"@grpc/grpc-js": "^1.7.3",
|
"@grpc/grpc-js": "^1.7.3",
|
||||||
@@ -552,7 +552,7 @@
|
|||||||
"form-urlencoded": "^6.1.0",
|
"form-urlencoded": "^6.1.0",
|
||||||
"google-protobuf": "^3.21.2",
|
"google-protobuf": "^3.21.2",
|
||||||
"ibm-watson": "^7.1.2",
|
"ibm-watson": "^7.1.2",
|
||||||
"microsoft-cognitiveservices-speech-sdk": "^1.24.0",
|
"microsoft-cognitiveservices-speech-sdk": "^1.24.1",
|
||||||
"redis": "^3.1.2",
|
"redis": "^3.1.2",
|
||||||
"undici": "^5.11.0"
|
"undici": "^5.11.0"
|
||||||
}
|
}
|
||||||
@@ -4795,9 +4795,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/microsoft-cognitiveservices-speech-sdk": {
|
"node_modules/microsoft-cognitiveservices-speech-sdk": {
|
||||||
"version": "1.24.0",
|
"version": "1.24.1",
|
||||||
"resolved": "https://registry.npmjs.org/microsoft-cognitiveservices-speech-sdk/-/microsoft-cognitiveservices-speech-sdk-1.24.0.tgz",
|
"resolved": "https://registry.npmjs.org/microsoft-cognitiveservices-speech-sdk/-/microsoft-cognitiveservices-speech-sdk-1.24.1.tgz",
|
||||||
"integrity": "sha512-26/lmzsRHgIzP03DSts1pqp+5UINdpDo35jnmi9QRzhYebtLrdEydwPR9TF0wa9TB+vbMeMFWD+gy9VKfWXAvQ==",
|
"integrity": "sha512-7oAlVge4cPnCeNHeIVUQe4tKZmfGtsriD8rjl7uAoPcwG4hF3BXVVhUEkhlW+B8i5zVAJl3fH4BbAfZPCtrbvg==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"agent-base": "^6.0.1",
|
"agent-base": "^6.0.1",
|
||||||
@@ -7813,9 +7813,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@jambonz/realtimedb-helpers": {
|
"@jambonz/realtimedb-helpers": {
|
||||||
"version": "0.6.1",
|
"version": "0.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.6.2.tgz",
|
||||||
"integrity": "sha512-R+MYjgRH59ZLSfwaPC/iNgFMS4G1TECD95CNoAO6n7uVQMADOQPiecpBBRrXEp2aJvPvLqKcsGZbivCTO9p1Ew==",
|
"integrity": "sha512-hZNjEFGtMg5Rvn50P64qvTBZpN12iXML9rNJ83JxNk6eCznavhhJ/aw0K6ouetQ+wesvN22/RSk0I5HhAvVlbA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@google-cloud/text-to-speech": "^4.0.3",
|
"@google-cloud/text-to-speech": "^4.0.3",
|
||||||
"@grpc/grpc-js": "^1.7.3",
|
"@grpc/grpc-js": "^1.7.3",
|
||||||
@@ -7826,7 +7826,7 @@
|
|||||||
"form-urlencoded": "^6.1.0",
|
"form-urlencoded": "^6.1.0",
|
||||||
"google-protobuf": "^3.21.2",
|
"google-protobuf": "^3.21.2",
|
||||||
"ibm-watson": "^7.1.2",
|
"ibm-watson": "^7.1.2",
|
||||||
"microsoft-cognitiveservices-speech-sdk": "^1.24.0",
|
"microsoft-cognitiveservices-speech-sdk": "^1.24.1",
|
||||||
"redis": "^3.1.2",
|
"redis": "^3.1.2",
|
||||||
"undici": "^5.11.0"
|
"undici": "^5.11.0"
|
||||||
}
|
}
|
||||||
@@ -11117,9 +11117,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"microsoft-cognitiveservices-speech-sdk": {
|
"microsoft-cognitiveservices-speech-sdk": {
|
||||||
"version": "1.24.0",
|
"version": "1.24.1",
|
||||||
"resolved": "https://registry.npmjs.org/microsoft-cognitiveservices-speech-sdk/-/microsoft-cognitiveservices-speech-sdk-1.24.0.tgz",
|
"resolved": "https://registry.npmjs.org/microsoft-cognitiveservices-speech-sdk/-/microsoft-cognitiveservices-speech-sdk-1.24.1.tgz",
|
||||||
"integrity": "sha512-26/lmzsRHgIzP03DSts1pqp+5UINdpDo35jnmi9QRzhYebtLrdEydwPR9TF0wa9TB+vbMeMFWD+gy9VKfWXAvQ==",
|
"integrity": "sha512-7oAlVge4cPnCeNHeIVUQe4tKZmfGtsriD8rjl7uAoPcwG4hF3BXVVhUEkhlW+B8i5zVAJl3fH4BbAfZPCtrbvg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"agent-base": "^6.0.1",
|
"agent-base": "^6.0.1",
|
||||||
"asn1.js-rfc2560": "^5.0.1",
|
"asn1.js-rfc2560": "^5.0.1",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jambonz/db-helpers": "^0.7.3",
|
"@jambonz/db-helpers": "^0.7.3",
|
||||||
"@jambonz/http-health-check": "^0.0.1",
|
"@jambonz/http-health-check": "^0.0.1",
|
||||||
"@jambonz/realtimedb-helpers": "^0.6.1",
|
"@jambonz/realtimedb-helpers": "^0.6.2",
|
||||||
"@jambonz/stats-collector": "^0.1.6",
|
"@jambonz/stats-collector": "^0.1.6",
|
||||||
"@jambonz/time-series": "^0.2.5",
|
"@jambonz/time-series": "^0.2.5",
|
||||||
"@opentelemetry/api": "^1.2.0",
|
"@opentelemetry/api": "^1.2.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user