speechstate 2.4.0 → 2.4.1-pr9-1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"speechstate.d.ts","sourceRoot":"","sources":["../src/speechstate.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACrD,UAAU,SAAS;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED,QAAA,MAAM,WAAW,kiBAmWhB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"speechstate.d.ts","sourceRoot":"","sources":["../src/speechstate.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACrD,UAAU,SAAS;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2Vf,CAAC;AAEH,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,11 +1,67 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.speechstate = void 0;
4
13
  const xstate_1 = require("xstate");
5
14
  const tts_1 = require("./tts");
6
15
  const asr_1 = require("./asr");
7
- const speechstate = (0, xstate_1.createMachine)({
16
+ const speechstate = (0, xstate_1.setup)({
8
17
  types: {},
18
+ actors: {
19
+ audioContext: (0, xstate_1.fromPromise)(() => __awaiter(void 0, void 0, void 0, function* () {
20
+ const audioContext = new AudioContext();
21
+ navigator.mediaDevices
22
+ .getUserMedia({ audio: true })
23
+ .then(function (stream) {
24
+ audioContext.createMediaStreamSource(stream);
25
+ });
26
+ return audioContext;
27
+ })),
28
+ tts: tts_1.ttsMachine,
29
+ asr: asr_1.asrMachine,
30
+ },
31
+ actions: {
32
+ spawnTTS: (0, xstate_1.assign)({
33
+ ttsRef: ({ context, spawn }) => {
34
+ return spawn("tts", {
35
+ id: "ttsRef",
36
+ input: {
37
+ ttsDefaultVoice: context.settings.ttsDefaultVoice,
38
+ ttsLexicon: context.settings.ttsLexicon,
39
+ audioContext: context.audioContext,
40
+ azureCredentials: context.settings.azureCredentials,
41
+ azureRegion: context.settings.azureRegion,
42
+ },
43
+ });
44
+ },
45
+ }),
46
+ spawnASR: (0, xstate_1.assign)({
47
+ asrRef: ({ context, spawn }) => {
48
+ return spawn("asr", {
49
+ id: "asrRef",
50
+ input: {
51
+ asrDefaultCompleteTimeout: context.settings.asrDefaultCompleteTimeout,
52
+ asrDefaultNoInputTimeout: context.settings.asrDefaultNoInputTimeout,
53
+ locale: context.settings.locale,
54
+ audioContext: context.audioContext,
55
+ azureCredentials: context.settings.azureCredentials,
56
+ azureRegion: context.settings.azureRegion,
57
+ azureLanguageCredentials: context.settings.azureLanguageCredentials,
58
+ speechRecognitionEndpointId: context.settings.speechRecognitionEndpointId,
59
+ },
60
+ });
61
+ },
62
+ }),
63
+ },
64
+ }).createMachine({
9
65
  context: ({ input }) => ({
10
66
  settings: input,
11
67
  }),
@@ -38,46 +94,16 @@ const speechstate = (0, xstate_1.createMachine)({
38
94
  src: "audioContext",
39
95
  onDone: {
40
96
  target: "Spawn",
41
- actions: (0, xstate_1.assign)({
42
- audioContext: ({ event }) => event.output,
97
+ actions: (0, xstate_1.assign)(({ event }) => {
98
+ return {
99
+ audioContext: event.output,
100
+ };
43
101
  }),
44
102
  },
45
103
  },
46
104
  },
47
105
  Spawn: {
48
- entry: [
49
- (0, xstate_1.assign)({
50
- ttsRef: ({ context, spawn }) => {
51
- return spawn(tts_1.ttsMachine, {
52
- id: "ttsRef",
53
- input: {
54
- ttsDefaultVoice: context.settings.ttsDefaultVoice,
55
- ttsLexicon: context.settings.ttsLexicon,
56
- audioContext: context.audioContext,
57
- azureCredentials: context.settings.azureCredentials,
58
- azureRegion: context.settings.azureRegion,
59
- },
60
- });
61
- },
62
- }),
63
- (0, xstate_1.assign)({
64
- asrRef: ({ context, spawn }) => {
65
- return spawn(asr_1.asrMachine, {
66
- id: "asrRef",
67
- input: {
68
- asrDefaultCompleteTimeout: context.settings.asrDefaultCompleteTimeout,
69
- asrDefaultNoInputTimeout: context.settings.asrDefaultNoInputTimeout,
70
- locale: context.settings.locale,
71
- audioContext: context.audioContext,
72
- azureCredentials: context.settings.azureCredentials,
73
- azureRegion: context.settings.azureRegion,
74
- azureLanguageCredentials: context.settings.azureLanguageCredentials,
75
- speechRecognitionEndpointId: context.settings.speechRecognitionEndpointId,
76
- },
77
- });
78
- },
79
- }),
80
- ],
106
+ entry: { type: "spawnTTS" },
81
107
  after: {
82
108
  300000: {
83
109
  target: "Spawn",
@@ -189,6 +215,15 @@ const speechstate = (0, xstate_1.createMachine)({
189
215
  (0, xstate_1.sendParent)({ type: "SPEAK_COMPLETE" }),
190
216
  ],
191
217
  },
218
+ STREAMING_SET_PERSONA: {
219
+ actions: [
220
+ () => console.debug("[TTS→SpSt] STREAMING_SET_PERSONA"),
221
+ (0, xstate_1.sendParent)(({ event }) => ({
222
+ type: "STREAMING_SET_PERSONA",
223
+ value: event.value,
224
+ })),
225
+ ],
226
+ },
192
227
  },
193
228
  states: {
194
229
  Proceed: {
@@ -304,34 +339,5 @@ const speechstate = (0, xstate_1.createMachine)({
304
339
  },
305
340
  },
306
341
  },
307
- }, {
308
- actors: {
309
- audioContext: (0, xstate_1.fromPromise)(() => {
310
- const audioContext = new (window.AudioContext ||
311
- window.webkitAudioContext)();
312
- navigator.mediaDevices
313
- .getUserMedia({ audio: true })
314
- .then(function (stream) {
315
- audioContext.createMediaStreamSource(stream);
316
- });
317
- return audioContext;
318
- }),
319
- },
320
- actions: {
321
- // logRecResult: ({ event }) => {
322
- // console.log("U>", (event as any).value[0]["utterance"], {
323
- // confidence: (event as any).value[0]["confidence"],
324
- // });
325
- // },
326
- // logAgenda: ({ context, event }) => {
327
- // console.log("S>", (event as any).value, {
328
- // passivity: `${context.tdmPassivity ?? "∞"} ms`,
329
- // speechCompleteTimeout: `${
330
- // context.tdmSpeechCompleteTimeout ||
331
- // context.settings.completeTimeout
332
- // } ms`,
333
- // });
334
- // },
335
- },
336
342
  });
337
343
  exports.speechstate = speechstate;