uneeq-js 2.41.0 → 2.41.1

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.
@@ -8,7 +8,9 @@ export declare class VoiceInputManager {
8
8
  private messages;
9
9
  private enableMicrophone;
10
10
  private readonly microphoneEngageVolume;
11
+ private readonly microphoneDisengageVolume;
11
12
  private readonly voiceActivityNotSpeakingTimeoutMS;
13
+ private readonly voiceActivityAllowInterruptions;
12
14
  private soundMeter;
13
15
  private audioContext;
14
16
  private digitalHumanSpeaking;
@@ -27,4 +29,5 @@ export declare class VoiceInputManager {
27
29
  private apiStopRecording;
28
30
  private micActivityConnected;
29
31
  private handleVoiceActivity;
32
+ private clearSilenceTimeout;
30
33
  }
package/dist/umd/index.js CHANGED
@@ -18117,7 +18117,7 @@ function zipAll(project) {
18117
18117
  /* 224 */
18118
18118
  /***/ (function(module) {
18119
18119
 
18120
- module.exports = JSON.parse("{\"name\":\"uneeq-js\",\"version\":\"2.41.0\",\"description\":\"\",\"main\":\"dist/index.js\",\"types\":\"dist/src/index.d.ts\",\"scripts\":{\"start\":\"npx webpack -w\",\"test-local\":\"./node_modules/karma/bin/karma start karma.conf.js -logLevel=DEBUG\",\"test\":\"./node_modules/karma/bin/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\":\"./node_modules/tslint/bin/tslint -p tsconfig.json --fix\",\"docs\":\"./node_modules/typedoc/bin/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.0\",\"intrinsic-scale\":\"^3.0.4\",\"promjs\":\"^0.4.1\",\"rxjs\":\"^6.2.2\",\"rxjs-compat\":\"^6.3.2\",\"simple-peer\":\"9.11.0\",\"webrtc-adapter\":\"8.1.0\"},\"devDependencies\":{\"@types/jasmine\":\"^2.8.8\",\"@types/node\":\"^10.9.4\",\"fetch-mock\":\"7.7.3\",\"ignore-styles\":\"^5.0.1\",\"jasmine\":\"^3.2.0\",\"jasmine-class-mock\":\"^1.0.1\",\"jasmine-core\":\"^3.3.0\",\"karma\":\"^5.0.0\",\"karma-chrome-launcher\":\"^2.2.0\",\"karma-firefox-launcher\":\"^1.1.0\",\"karma-jasmine\":\"^2.0.1\",\"karma-jasmine-html-reporter\":\"^1.4.0\",\"karma-requirejs\":\"^1.1.0\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-typescript\":\"^5.0.0\",\"karma-typescript-es6-transform\":\"^5.0.0\",\"nock\":\"^9.6.1\",\"requirejs\":\"^2.3.6\",\"ts-loader\":\"^5.0.0\",\"ts-node\":\"^7.0.1\",\"tslint\":\"^5.11.0\",\"tslint-no-focused-test\":\"^0.5.0\",\"typedoc\":\"^0.18.0\",\"typescript\":\"^3.9.7\",\"webpack\":\"^4.17.1\",\"webpack-cli\":\"^3.1.0\"}}");
18120
+ module.exports = JSON.parse("{\"name\":\"uneeq-js\",\"version\":\"2.41.1\",\"description\":\"\",\"main\":\"dist/index.js\",\"types\":\"dist/src/index.d.ts\",\"scripts\":{\"start\":\"npx webpack -w\",\"test-local\":\"./node_modules/karma/bin/karma start karma.conf.js -logLevel=DEBUG\",\"test\":\"./node_modules/karma/bin/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\":\"./node_modules/tslint/bin/tslint -p tsconfig.json --fix\",\"docs\":\"./node_modules/typedoc/bin/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.0\",\"intrinsic-scale\":\"^3.0.4\",\"promjs\":\"^0.4.1\",\"rxjs\":\"^6.2.2\",\"rxjs-compat\":\"^6.3.2\",\"simple-peer\":\"9.11.0\",\"webrtc-adapter\":\"8.1.0\"},\"devDependencies\":{\"@types/jasmine\":\"^2.8.8\",\"@types/node\":\"^10.9.4\",\"fetch-mock\":\"7.7.3\",\"ignore-styles\":\"^5.0.1\",\"jasmine\":\"^3.2.0\",\"jasmine-class-mock\":\"^1.0.1\",\"jasmine-core\":\"^3.3.0\",\"karma\":\"^5.0.0\",\"karma-chrome-launcher\":\"^2.2.0\",\"karma-firefox-launcher\":\"^1.1.0\",\"karma-jasmine\":\"^2.0.1\",\"karma-jasmine-html-reporter\":\"^1.4.0\",\"karma-requirejs\":\"^1.1.0\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-typescript\":\"^5.0.0\",\"karma-typescript-es6-transform\":\"^5.0.0\",\"nock\":\"^9.6.1\",\"requirejs\":\"^2.3.6\",\"ts-loader\":\"^5.0.0\",\"ts-node\":\"^7.0.1\",\"tslint\":\"^5.11.0\",\"tslint-no-focused-test\":\"^0.5.0\",\"typedoc\":\"^0.18.0\",\"typescript\":\"^3.9.7\",\"webpack\":\"^4.17.1\",\"webpack-cli\":\"^3.1.0\"}}");
18121
18121
 
18122
18122
  /***/ }),
18123
18123
  /* 225 */
@@ -52871,10 +52871,14 @@ class VoiceInputManager {
52871
52871
  this.enableMicrophone = enableMicrophone;
52872
52872
  // These constants are not configurable by implementers, but could be considered
52873
52873
  // TODO in future, microphoneEngageVolume could be dynamic based on how noisy the users environment is.
52874
- // the threshold for when to turn on/off automatic microphone recordings
52874
+ // the threshold for when to turn on microphone recording when in VOICE_ACTIVITY mode (and call startRecording() API)
52875
52875
  this.microphoneEngageVolume = 0.02;
52876
+ // the threshold for when to turn off a microphone recording when in VOICE_ACTIVITY mode (and call stopRecording() API)
52877
+ this.microphoneDisengageVolume = 0.02;
52876
52878
  // the time to wait after mic activity drops below threshold before stopping recording
52877
52879
  this.voiceActivityNotSpeakingTimeoutMS = 1000;
52880
+ // whether to allow interruptions when in VOICE_ACTIVITY mode
52881
+ this.voiceActivityAllowInterruptions = false;
52878
52882
  this.digitalHumanSpeaking = false; // track whether DH is speaking and prevent interruptions.
52879
52883
  this.recording = false;
52880
52884
  this.setVoiceInputMode(options.voiceInputMode);
@@ -52977,17 +52981,17 @@ class VoiceInputManager {
52977
52981
  this.messages.next(new MessageTypes_1.MicActivityMessage(level));
52978
52982
  }
52979
52983
  // Run Volume Activity detection process
52980
- if (this.options.voiceInputMode === VoiceInputMode_1.VoiceInputMode.VOICE_ACTIVITY && !this.digitalHumanSpeaking) {
52984
+ if (this.options.voiceInputMode === VoiceInputMode_1.VoiceInputMode.VOICE_ACTIVITY &&
52985
+ (!this.digitalHumanSpeaking || this.voiceActivityAllowInterruptions)) {
52981
52986
  // possible improvement: system could wait to get multiple activty messages above threshold before starting recording
52982
52987
  if (level > this.microphoneEngageVolume) {
52983
52988
  if (!this.recording) {
52984
52989
  this.apiStartRecording();
52985
52990
  }
52986
- if (this.silenceTimeout) {
52987
- clearTimeout(this.silenceTimeout);
52988
- }
52991
+ this.clearSilenceTimeout();
52989
52992
  }
52990
- else if (level < this.microphoneEngageVolume && this.recording) {
52993
+ else if (level < this.microphoneDisengageVolume && this.recording) {
52994
+ this.clearSilenceTimeout();
52991
52995
  this.silenceTimeout = setTimeout(() => {
52992
52996
  if (this.recording) {
52993
52997
  this.apiStopRecording();
@@ -52996,6 +53000,11 @@ class VoiceInputManager {
52996
53000
  }
52997
53001
  }
52998
53002
  }
53003
+ clearSilenceTimeout() {
53004
+ if (this.silenceTimeout) {
53005
+ clearTimeout(this.silenceTimeout);
53006
+ }
53007
+ }
52999
53008
  }
53000
53009
  exports.VoiceInputManager = VoiceInputManager;
53001
53010
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uneeq-js",
3
- "version": "2.41.0",
3
+ "version": "2.41.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/src/index.d.ts",
package/readme.md CHANGED
@@ -8,6 +8,9 @@ https://docs.uneeq.io/#/js_sdk
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.41.1
12
+ * Fix for VOICE_ACTIVITY disengaging during long utterances.
13
+
11
14
  #### 2.41.0
12
15
  * Added support for voice activity detection
13
16