uneeq-js 2.47.1 → 2.47.2

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/umd/index.js CHANGED
@@ -3672,14 +3672,14 @@ const online_status_service_1 = __webpack_require__(320);
3672
3672
  const prom_1 = __webpack_require__(290);
3673
3673
  const resume_session_check_1 = __webpack_require__(321);
3674
3674
  const speech_handler_1 = __webpack_require__(323);
3675
- const stream_manager_1 = __webpack_require__(335);
3675
+ const stream_manager_1 = __webpack_require__(334);
3676
3676
  const uneeq_local_storage_1 = __webpack_require__(322);
3677
- const voice_input_manager_1 = __webpack_require__(336);
3677
+ const voice_input_manager_1 = __webpack_require__(335);
3678
3678
  const MessageTypes_1 = __webpack_require__(287);
3679
- const NewSessionRequest_1 = __webpack_require__(339);
3679
+ const NewSessionRequest_1 = __webpack_require__(338);
3680
3680
  const PublishSubscribeState_1 = __webpack_require__(248);
3681
- const SourceApp_1 = __webpack_require__(340);
3682
- const VoiceInputMode_1 = __webpack_require__(338);
3681
+ const SourceApp_1 = __webpack_require__(339);
3682
+ const VoiceInputMode_1 = __webpack_require__(337);
3683
3683
  class Uneeq {
3684
3684
  /**
3685
3685
  * The active session id as a string. If the session has not started yet value will be null
@@ -51161,12 +51161,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
51161
51161
  };
51162
51162
  Object.defineProperty(exports, "__esModule", ({ value: true }));
51163
51163
  exports.SpeechHandler = void 0;
51164
- const crossoriginworker_1 = __importDefault(__webpack_require__(324));
51165
- const opus_media_recorder_1 = __importDefault(__webpack_require__(325));
51166
- const ring_buffer_ts_1 = __webpack_require__(328);
51167
- const real_time_vad_1 = __webpack_require__(329);
51164
+ const opus_media_recorder_1 = __importDefault(__webpack_require__(324));
51165
+ const ring_buffer_ts_1 = __webpack_require__(327);
51166
+ const real_time_vad_1 = __webpack_require__(328);
51168
51167
  const MessageTypes_1 = __webpack_require__(287);
51169
- const SpeechRecognitionMessageAction_1 = __webpack_require__(334);
51168
+ const SpeechRecognitionMessageAction_1 = __webpack_require__(333);
51170
51169
  const logger_1 = __webpack_require__(250);
51171
51170
  const speechBufferLength = 5;
51172
51171
  const audioChunkSizeMs = 100;
@@ -51295,10 +51294,23 @@ class SpeechHandler {
51295
51294
  }
51296
51295
  initMediaRecorder(stream) {
51297
51296
  return __awaiter(this, void 0, void 0, function* () {
51298
- const workerUrl = yield (0, crossoriginworker_1.default)(this.options.assetBasePath + 'encoderWorker.umd.js');
51297
+ // The script there simply posts back an "Hello" message
51298
+ // Obviously cross-origin here
51299
+ const cross_origin_script_url = this.options.assetBasePath + 'encoderWorker.umd.js';
51300
+ const worker_url = getWorkerURL(cross_origin_script_url);
51301
+ const worker = new Worker(worker_url);
51302
+ // worker.onmessage = (evt) => console.log( evt.data );
51303
+ // URL.revokeObjectURL( worker_url );
51304
+ // Returns a blob:// URL which points
51305
+ // to a javascript file which will call
51306
+ // importScripts with the given URL
51307
+ function getWorkerURL(url) {
51308
+ const content = `importScripts( "${url}" );`;
51309
+ return URL.createObjectURL(new Blob([content], { type: "text/javascript" }));
51310
+ }
51299
51311
  const workerOptions = {
51300
51312
  encoderWorkerFactory: () => {
51301
- return new Worker(workerUrl);
51313
+ return worker;
51302
51314
  },
51303
51315
  OggOpusEncoderWasmPath: this.options.assetBasePath + 'OggOpusEncoder.wasm',
51304
51316
  WebMOpusEncoderWasmPath: this.options.assetBasePath + 'WebMOpusEncoder.wasm'
@@ -51336,61 +51348,10 @@ exports.SpeechHandler = SpeechHandler;
51336
51348
 
51337
51349
  /***/ }),
51338
51350
  /* 324 */
51339
- /***/ ((module) => {
51340
-
51341
- // Time to do some sketchy s**t... doo da doo da,
51342
- // Hope I get away with it oh doo da day
51343
-
51344
- const type = 'application/javascript';
51345
-
51346
- const getCrossOriginWorkerURL = (originalWorkerUrl, _options = {}) => {
51347
-
51348
- const options = {
51349
- skipSameOrigin: true,
51350
- useBlob: true,
51351
-
51352
- ..._options,
51353
- };
51354
-
51355
- if (!originalWorkerUrl.includes('://') || originalWorkerUrl.includes(window.location.origin)) {
51356
- // The same origin - Worker will run fine
51357
- return Promise.resolve(originalWorkerUrl);
51358
- }
51359
-
51360
- return new Promise((resolve, reject) =>
51361
- fetch(originalWorkerUrl)
51362
- .then((res) => res.text())
51363
- .then((codeString) => {
51364
- let workerPath = new URL(originalWorkerUrl).href.split('/');
51365
- workerPath.pop();
51366
-
51367
- const importScriptsFix = `const _importScripts = importScripts;
51368
- const _fixImports = (url) => new URL(url, '${workerPath.join('/') + '/'}').href;
51369
- importScripts = (...urls) => _importScripts(...urls.map(_fixImports));`;
51370
-
51371
- let finalURL = `data:${type},` + encodeURIComponent(importScriptsFix + codeString);
51372
-
51373
- if (options.useBlob) {
51374
- finalURL = URL.createObjectURL(
51375
- new Blob([`importScripts("${finalURL}")`], { type })
51376
- )
51377
- }
51378
-
51379
- resolve(finalURL);
51380
- })
51381
- .catch(reject)
51382
- );
51383
- };
51384
-
51385
- module.exports = getCrossOriginWorkerURL;
51386
-
51387
-
51388
- /***/ }),
51389
- /* 325 */
51390
51351
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
51391
51352
 
51392
- const { EventTarget, defineEventAttribute } = __webpack_require__(326);
51393
- const { detect } = __webpack_require__(327);
51353
+ const { EventTarget, defineEventAttribute } = __webpack_require__(325);
51354
+ const { detect } = __webpack_require__(326);
51394
51355
  const browser = detect();
51395
51356
 
51396
51357
  const AudioContext = __webpack_require__.g.AudioContext || __webpack_require__.g.webkitAudioContext;
@@ -51957,7 +51918,7 @@ module.exports = OpusMediaRecorder;
51957
51918
 
51958
51919
 
51959
51920
  /***/ }),
51960
- /* 326 */
51921
+ /* 325 */
51961
51922
  /***/ ((module, exports) => {
51962
51923
 
51963
51924
  "use strict";
@@ -52731,7 +52692,7 @@ module.exports.defineEventAttribute = defineEventAttribute
52731
52692
 
52732
52693
 
52733
52694
  /***/ }),
52734
- /* 327 */
52695
+ /* 326 */
52735
52696
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
52736
52697
 
52737
52698
  "use strict";
@@ -52911,13 +52872,13 @@ function createVersionParts(count) {
52911
52872
 
52912
52873
 
52913
52874
  /***/ }),
52914
- /* 328 */
52875
+ /* 327 */
52915
52876
  /***/ (function(module) {
52916
52877
 
52917
52878
  !function(e,t){if(true)module.exports=t();else { var s, r; }}(this,(()=>(()=>{"use strict";var e={d:(t,r)=>{for(var s in r)e.o(r,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:r[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{RingBuffer:()=>r});class r{static fromArray(e,t=0){const s=new r(t);return s.fromArray(e,0===t),s}constructor(e){if(this.buffer=[],this.pos=0,e<0)throw new RangeError("Invalid size.");this.size=e}getSize(){return this.size}getPos(){return this.pos}getBufferLength(){return this.buffer.length}add(...e){e.forEach((e=>{this.buffer[this.pos]=e,this.pos=(this.pos+1)%this.size}))}get(e){if(e<0&&(e+=this.buffer.length),!(e<0||e>this.buffer.length))return this.buffer.length<this.size?this.buffer[e]:this.buffer[(this.pos+e)%this.size]}getFirst(){return this.get(0)}getLast(){return this.get(-1)}getFirstN(e){return 0===e?[]:e<0?this.getLastN(-e):this.toArray().slice(0,e)}getLastN(e){return 0===e?[]:e<0?this.getFirstN(-e):this.toArray().slice(-e)}remove(e,t=1){if(e<0&&(e+=this.buffer.length),e<0||e>this.buffer.length)return[];const r=this.toArray(),s=r.splice(e,t);return this.fromArray(r),s}removeFirst(){return this.remove(0)[0]}removeLast(){return this.remove(-1)[0]}toArray(){return this.buffer.slice(this.pos).concat(this.buffer.slice(0,this.pos))}fromArray(e,t=!1){if(!Array.isArray(e))throw new TypeError("Input value is not an array.");t&&this.resize(e.length),0!==this.size&&(this.buffer=e.slice(-this.size),this.pos=this.buffer.length%this.size)}clear(){this.buffer=[],this.pos=0}resize(e){if(e<0)throw new RangeError("The size does not allow negative values.");if(0===e)this.clear();else if(e!==this.size){const t=this.toArray();this.fromArray(t.slice(-e)),this.pos=this.buffer.length%e}this.size=e}isFull(){return this.buffer.length===this.size}isEmpty(){return 0===this.buffer.length}}return t})()));
52918
52879
 
52919
52880
  /***/ }),
52920
- /* 329 */
52881
+ /* 328 */
52921
52882
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
52922
52883
 
52923
52884
  "use strict";
@@ -52966,11 +52927,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
52966
52927
  };
52967
52928
  Object.defineProperty(exports, "__esModule", ({ value: true }));
52968
52929
  exports.AudioNodeVAD = exports.MicVAD = exports.defaultRealTimeVADOptions = void 0;
52969
- const ort = __importStar(__webpack_require__(330));
52930
+ const ort = __importStar(__webpack_require__(329));
52970
52931
  const logger_1 = __webpack_require__(250);
52971
- const frame_processor_1 = __webpack_require__(331);
52972
- const messages_1 = __webpack_require__(332);
52973
- const models_1 = __webpack_require__(333);
52932
+ const frame_processor_1 = __webpack_require__(330);
52933
+ const messages_1 = __webpack_require__(331);
52934
+ const models_1 = __webpack_require__(332);
52974
52935
  exports.defaultRealTimeVADOptions = Object.assign(Object.assign({}, frame_processor_1.defaultFrameProcessorOptions), { onFrameProcessed: (probabilities) => { }, onVADMisfire: () => {
52975
52936
  logger_1.logger.debug('VAD misfire');
52976
52937
  }, onSpeechStart: () => {
@@ -53106,7 +53067,7 @@ exports.AudioNodeVAD = AudioNodeVAD;
53106
53067
 
53107
53068
 
53108
53069
  /***/ }),
53109
- /* 330 */
53070
+ /* 329 */
53110
53071
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
53111
53072
 
53112
53073
  /* provided dependency */ var process = __webpack_require__(254);
@@ -53119,7 +53080,7 @@ exports.AudioNodeVAD = AudioNodeVAD;
53119
53080
  //# sourceMappingURL=ort.min.js.map
53120
53081
 
53121
53082
  /***/ }),
53122
- /* 331 */
53083
+ /* 330 */
53123
53084
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
53124
53085
 
53125
53086
  "use strict";
@@ -53140,7 +53101,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
53140
53101
  Object.defineProperty(exports, "__esModule", ({ value: true }));
53141
53102
  exports.FrameProcessor = exports.validateOptions = exports.defaultFrameProcessorOptions = void 0;
53142
53103
  const logger_1 = __webpack_require__(250);
53143
- const messages_1 = __webpack_require__(332);
53104
+ const messages_1 = __webpack_require__(331);
53144
53105
  const RECOMMENDED_FRAME_SAMPLES = [512, 1024, 1536];
53145
53106
  exports.defaultFrameProcessorOptions = {
53146
53107
  positiveSpeechThreshold: 0.5,
@@ -53273,7 +53234,7 @@ exports.FrameProcessor = FrameProcessor;
53273
53234
 
53274
53235
 
53275
53236
  /***/ }),
53276
- /* 332 */
53237
+ /* 331 */
53277
53238
  /***/ ((__unused_webpack_module, exports) => {
53278
53239
 
53279
53240
  "use strict";
@@ -53290,7 +53251,7 @@ var Message;
53290
53251
 
53291
53252
 
53292
53253
  /***/ }),
53293
- /* 333 */
53254
+ /* 332 */
53294
53255
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
53295
53256
 
53296
53257
  "use strict";
@@ -53352,7 +53313,7 @@ Silero.new = (ort, modelFetcher) => __awaiter(void 0, void 0, void 0, function*
53352
53313
 
53353
53314
 
53354
53315
  /***/ }),
53355
- /* 334 */
53316
+ /* 333 */
53356
53317
  /***/ ((__unused_webpack_module, exports) => {
53357
53318
 
53358
53319
  "use strict";
@@ -53367,7 +53328,7 @@ var SpeechRecognitionMessageAction;
53367
53328
 
53368
53329
 
53369
53330
  /***/ }),
53370
- /* 335 */
53331
+ /* 334 */
53371
53332
  /***/ ((__unused_webpack_module, exports) => {
53372
53333
 
53373
53334
  "use strict";
@@ -53432,7 +53393,7 @@ exports.StreamManager = StreamManager;
53432
53393
 
53433
53394
 
53434
53395
  /***/ }),
53435
- /* 336 */
53396
+ /* 335 */
53436
53397
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
53437
53398
 
53438
53399
  "use strict";
@@ -53440,9 +53401,9 @@ exports.StreamManager = StreamManager;
53440
53401
  Object.defineProperty(exports, "__esModule", ({ value: true }));
53441
53402
  exports.VoiceInputManager = void 0;
53442
53403
  const operators_1 = __webpack_require__(238);
53443
- const soundmeter_1 = __webpack_require__(337);
53404
+ const soundmeter_1 = __webpack_require__(336);
53444
53405
  const MessageTypes_1 = __webpack_require__(287);
53445
- const VoiceInputMode_1 = __webpack_require__(338);
53406
+ const VoiceInputMode_1 = __webpack_require__(337);
53446
53407
  const logger_1 = __webpack_require__(250);
53447
53408
  class VoiceInputManager {
53448
53409
  constructor(options, api, messages, enableMicrophone) {
@@ -53610,7 +53571,7 @@ exports.VoiceInputManager = VoiceInputManager;
53610
53571
 
53611
53572
 
53612
53573
  /***/ }),
53613
- /* 337 */
53574
+ /* 336 */
53614
53575
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
53615
53576
 
53616
53577
  "use strict";
@@ -53689,7 +53650,7 @@ exports.SoundMeter = SoundMeter;
53689
53650
 
53690
53651
 
53691
53652
  /***/ }),
53692
- /* 338 */
53653
+ /* 337 */
53693
53654
  /***/ ((__unused_webpack_module, exports) => {
53694
53655
 
53695
53656
  "use strict";
@@ -53705,7 +53666,7 @@ var VoiceInputMode;
53705
53666
 
53706
53667
 
53707
53668
  /***/ }),
53708
- /* 339 */
53669
+ /* 338 */
53709
53670
  /***/ ((__unused_webpack_module, exports) => {
53710
53671
 
53711
53672
  "use strict";
@@ -53719,7 +53680,7 @@ var SessionType;
53719
53680
 
53720
53681
 
53721
53682
  /***/ }),
53722
- /* 340 */
53683
+ /* 339 */
53723
53684
  /***/ ((__unused_webpack_module, exports) => {
53724
53685
 
53725
53686
  "use strict";
package/package.json CHANGED
@@ -1,64 +1,64 @@
1
- {
2
- "name": "uneeq-js",
3
- "version": "2.47.1",
4
- "description": "",
5
- "main": "dist/index.js",
6
- "types": "dist/src/index.d.ts",
7
- "scripts": {
8
- "start": "npx webpack -w",
9
- "test-local": "npx karma start karma.conf.js -logLevel=DEBUG",
10
- "test": "npx karma start --browsers ChromeHeadless --single-run",
11
- "test:windows": "karma start karma.conf.js",
12
- "build": "webpack --config webpack.config.prod.js && webpack --config webpack.config.umd.js",
13
- "lint": "npx tslint -p tsconfig.json --fix",
14
- "docs": "npx typedoc --options"
15
- },
16
- "files": [
17
- "dist",
18
- "!dist/test"
19
- ],
20
- "author": "",
21
- "license": "ISC",
22
- "dependencies": {
23
- "@stomp/stompjs": "^6.0.0",
24
- "@uehreka/seriously": "^1.0.1",
25
- "crossoriginworker": "^1.1.0",
26
- "fast-text-encoding": "^1.0.0",
27
- "intrinsic-scale": "^3.0.4",
28
- "onnxruntime-web": "^1.15.1",
29
- "opus-media-recorder": "^0.8.0",
30
- "promjs": "^0.4.1",
31
- "ring-buffer-ts": "^1.2.0",
32
- "rxjs": "^7.8.1",
33
- "rxjs-compat": "^6.6.7",
34
- "simple-peer": "^9.11.1",
35
- "webrtc-adapter": "^8.2.3"
36
- },
37
- "devDependencies": {
38
- "@types/dom-mediacapture-record": "^1.0.16",
39
- "@types/jasmine": "^2.8.8",
40
- "@types/node": "^10.9.4",
41
- "fetch-mock": "7.7.3",
42
- "ignore-styles": "^5.0.1",
43
- "jasmine": "^5.1.0",
44
- "jasmine-core": "^5.1.0",
45
- "karma": "^6.4.2",
46
- "karma-chrome-launcher": "^3.2.0",
47
- "karma-firefox-launcher": "^2.1.2",
48
- "karma-jasmine": "^5.1.0",
49
- "karma-jasmine-html-reporter": "^2.1.0",
50
- "karma-requirejs": "^1.1.0",
51
- "karma-typescript": "^5.5.4",
52
- "karma-typescript-es6-transform": "^5.5.4",
53
- "nock": "^9.6.1",
54
- "requirejs": "^2.3.6",
55
- "ts-loader": "^9.4.4",
56
- "ts-node": "^7.0.1",
57
- "tslint": "^5.11.0",
58
- "tslint-no-focused-test": "^0.5.0",
59
- "typedoc": "^0.18.0",
60
- "typescript": "^5.1.6",
61
- "webpack": "^5.88.2",
62
- "webpack-cli": "^5.1.4"
63
- }
64
- }
1
+ {
2
+ "name": "uneeq-js",
3
+ "version": "2.47.2",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "types": "dist/src/index.d.ts",
7
+ "scripts": {
8
+ "start": "npx webpack -w",
9
+ "test-local": "npx karma start karma.conf.js -logLevel=DEBUG",
10
+ "test": "npx karma start --browsers ChromeHeadless --single-run",
11
+ "test:windows": "karma start karma.conf.js",
12
+ "build": "webpack --config webpack.config.prod.js && webpack --config webpack.config.umd.js",
13
+ "lint": "npx tslint -p tsconfig.json --fix",
14
+ "docs": "npx typedoc --options"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "!dist/test"
19
+ ],
20
+ "author": "",
21
+ "license": "ISC",
22
+ "dependencies": {
23
+ "@stomp/stompjs": "^6.0.0",
24
+ "@uehreka/seriously": "^1.0.1",
25
+ "crossoriginworker": "^1.1.0",
26
+ "fast-text-encoding": "^1.0.0",
27
+ "intrinsic-scale": "^3.0.4",
28
+ "onnxruntime-web": "^1.15.1",
29
+ "opus-media-recorder": "^0.8.0",
30
+ "promjs": "^0.4.1",
31
+ "ring-buffer-ts": "^1.2.0",
32
+ "rxjs": "^7.8.1",
33
+ "rxjs-compat": "^6.6.7",
34
+ "simple-peer": "^9.11.1",
35
+ "webrtc-adapter": "^8.2.3"
36
+ },
37
+ "devDependencies": {
38
+ "@types/dom-mediacapture-record": "^1.0.16",
39
+ "@types/jasmine": "^2.8.8",
40
+ "@types/node": "^10.9.4",
41
+ "fetch-mock": "7.7.3",
42
+ "ignore-styles": "^5.0.1",
43
+ "jasmine": "^5.1.0",
44
+ "jasmine-core": "^5.1.0",
45
+ "karma": "^6.4.2",
46
+ "karma-chrome-launcher": "^3.2.0",
47
+ "karma-firefox-launcher": "^2.1.2",
48
+ "karma-jasmine": "^5.1.0",
49
+ "karma-jasmine-html-reporter": "^2.1.0",
50
+ "karma-requirejs": "^1.1.0",
51
+ "karma-typescript": "^5.5.4",
52
+ "karma-typescript-es6-transform": "^5.5.4",
53
+ "nock": "^9.6.1",
54
+ "requirejs": "^2.3.6",
55
+ "ts-loader": "^9.4.4",
56
+ "ts-node": "^7.0.1",
57
+ "tslint": "^5.11.0",
58
+ "tslint-no-focused-test": "^0.5.0",
59
+ "typedoc": "^0.18.0",
60
+ "typescript": "^5.1.6",
61
+ "webpack": "^5.88.2",
62
+ "webpack-cli": "^5.1.4"
63
+ }
64
+ }