uneeq-js 2.53.0 → 2.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/src/service/speech-handler.d.ts +2 -1
- package/dist/umd/index.js +25 -7
- package/package.json +1 -1
- package/readme.md +3 -0
package/dist/umd/index.js
CHANGED
|
@@ -13313,7 +13313,7 @@ exports.race = race;
|
|
|
13313
13313
|
/***/ ((module) => {
|
|
13314
13314
|
|
|
13315
13315
|
"use strict";
|
|
13316
|
-
module.exports = JSON.parse('{"name":"uneeq-js","version":"2.
|
|
13316
|
+
module.exports = JSON.parse('{"name":"uneeq-js","version":"2.54.0","description":"","main":"dist/index.js","types":"dist/src/index.d.ts","scripts":{"start":"npx webpack -w","test-local":"npx karma start karma.conf.js -logLevel=DEBUG","test":"npx karma start --browsers ChromeHeadless --single-run","test:windows":"karma start karma.conf.js","build":"webpack --config webpack.config.prod.js && webpack --config webpack.config.umd.js","lint":"npx tslint -p tsconfig.json --fix","docs":"npx typedoc --options"},"files":["dist","!dist/test"],"author":"","license":"ISC","dependencies":{"@stomp/stompjs":"^6.0.0","@uehreka/seriously":"^1.0.1","fast-text-encoding":"^1.0.6","intrinsic-scale":"^3.0.4","onnxruntime-web":"^1.15.1","promjs":"^0.4.1","ring-buffer-ts":"^1.2.0","rxjs":"^7.8.1","rxjs-compat":"^6.6.7","simple-peer":"^9.11.1","webrtc-adapter":"^8.2.3"},"devDependencies":{"@types/dom-mediacapture-record":"^1.0.16","@types/jasmine":"^2.8.8","@types/node":"^10.9.4","fetch-mock":"7.7.3","ignore-styles":"^5.0.1","jasmine":"^5.1.0","jasmine-core":"^5.1.0","karma":"6.4.3","karma-chrome-launcher":"^3.2.0","karma-firefox-launcher":"^2.1.2","karma-jasmine":"^5.1.0","karma-jasmine-html-reporter":"^2.1.0","karma-requirejs":"^1.1.0","karma-typescript":"^5.5.4","karma-typescript-es6-transform":"^5.5.4","nock":"^9.6.1","requirejs":"^2.3.6","ts-loader":"^9.4.4","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-no-focused-test":"^0.5.0","typedoc":"^0.18.0","typescript":"^5.1.6","webpack":"^5.88.2","webpack-cli":"^5.1.4"}}');
|
|
13317
13317
|
|
|
13318
13318
|
/***/ }),
|
|
13319
13319
|
/* 242 */
|
|
@@ -51463,9 +51463,15 @@ class SpeechHandler {
|
|
|
51463
51463
|
logger_1.logger.log(this.logPrefix + 'Got a websocket message: ', wsMsg);
|
|
51464
51464
|
try {
|
|
51465
51465
|
const msg = JSON.parse(wsMsg.data);
|
|
51466
|
-
|
|
51467
|
-
|
|
51468
|
-
|
|
51466
|
+
const result = msg.results ? msg.results[0] : null;
|
|
51467
|
+
if (msg.state === 'response' && result) {
|
|
51468
|
+
console.log(`${this.logPrefix} Speech transcription result ${JSON.stringify(result)}`);
|
|
51469
|
+
if (this.options.enableVad) {
|
|
51470
|
+
this.handleVadTranscriptionResult(result);
|
|
51471
|
+
}
|
|
51472
|
+
else {
|
|
51473
|
+
this.handlePttTranscriptionResult(result);
|
|
51474
|
+
}
|
|
51469
51475
|
}
|
|
51470
51476
|
}
|
|
51471
51477
|
catch (err) {
|
|
@@ -51522,7 +51528,7 @@ class SpeechHandler {
|
|
|
51522
51528
|
initMicrophone() {
|
|
51523
51529
|
if (!this.stream) {
|
|
51524
51530
|
navigator.mediaDevices.getUserMedia({
|
|
51525
|
-
audio: { echoCancellation:
|
|
51531
|
+
audio: { echoCancellation: true, sampleRate: audioSampleRate, channelCount: audioChannelCount }
|
|
51526
51532
|
})
|
|
51527
51533
|
.then((stream) => {
|
|
51528
51534
|
this.stream = stream;
|
|
@@ -51569,8 +51575,7 @@ class SpeechHandler {
|
|
|
51569
51575
|
* If the recording is live (VAD), append final STT results until recording is no longer live,
|
|
51570
51576
|
then send it as a question.
|
|
51571
51577
|
*/
|
|
51572
|
-
|
|
51573
|
-
logger_1.logger.log(this.logPrefix + `Speech transcription (${result.confidence} confidence): ${result.transcript}`);
|
|
51578
|
+
handlePttTranscriptionResult(result) {
|
|
51574
51579
|
this.awaitingFinalTranscript = !result.final;
|
|
51575
51580
|
try {
|
|
51576
51581
|
if (this.recordingLive) {
|
|
@@ -51610,6 +51615,19 @@ class SpeechHandler {
|
|
|
51610
51615
|
this.storedTranscription = undefined;
|
|
51611
51616
|
}
|
|
51612
51617
|
}
|
|
51618
|
+
handleVadTranscriptionResult(result) {
|
|
51619
|
+
if (result.final) {
|
|
51620
|
+
this.options.chatMetadata.userSpokenLocale = result.language_code;
|
|
51621
|
+
this.options.api.avatarAsk(result.transcript, this.options.chatMetadata);
|
|
51622
|
+
}
|
|
51623
|
+
else if (this.digitalHumanSpeaking) {
|
|
51624
|
+
this.options.api.stopSpeaking();
|
|
51625
|
+
this.digitalHumanSpeaking = false;
|
|
51626
|
+
}
|
|
51627
|
+
if (result.stability > transcriptionStabilityThreshold || result.final) {
|
|
51628
|
+
this.options.messages.next(new MessageTypes_1.SpeechTranscriptionMessage(result));
|
|
51629
|
+
}
|
|
51630
|
+
}
|
|
51613
51631
|
}
|
|
51614
51632
|
exports.SpeechHandler = SpeechHandler;
|
|
51615
51633
|
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -8,6 +8,9 @@ https://docs.uneeq.io/build-your-own-experience
|
|
|
8
8
|
To use uneeq-js with a typescript version < 3.8, 'skipLibCheck' must be set to true.
|
|
9
9
|
|
|
10
10
|
## Release Notes
|
|
11
|
+
#### 2.54.0
|
|
12
|
+
* Re-enabled echoCancellation and fixed an issue that caused speech recognition to perform poorly in high latency environments.
|
|
13
|
+
|
|
11
14
|
#### 2.53.0
|
|
12
15
|
* Disabled echoCancellation due to performance issues.
|
|
13
16
|
|