speechstate 2.0.0-beta.2 → 2.0.0-beta.4
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/asr.js +1 -1
- package/dist/speechstate.js +29 -29
- package/dist/tts.js +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +51 -51
package/dist/asr.js
CHANGED
|
@@ -187,7 +187,7 @@ exports.asrMachine = (0, xstate_1.createMachine)({
|
|
|
187
187
|
const { SpeechGrammarList, SpeechRecognition } = (0, SpeechToText_1.default)({
|
|
188
188
|
audioContext: input.audioContext,
|
|
189
189
|
credentials: {
|
|
190
|
-
region: REGION,
|
|
190
|
+
region: REGION,
|
|
191
191
|
authorizationToken: input.azureAuthorizationToken,
|
|
192
192
|
},
|
|
193
193
|
});
|
package/dist/speechstate.js
CHANGED
|
@@ -12,21 +12,21 @@ const speechstate = (0, xstate_1.createMachine)({
|
|
|
12
12
|
id: "speechstate",
|
|
13
13
|
type: "parallel",
|
|
14
14
|
states: {
|
|
15
|
-
|
|
16
|
-
initial: "
|
|
15
|
+
AsrTtsSpawner: {
|
|
16
|
+
initial: "Idle",
|
|
17
17
|
states: {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
Idle: { on: { PREPARE: "CreateAudioContext" } },
|
|
19
|
+
CreateAudioContext: {
|
|
20
20
|
invoke: {
|
|
21
21
|
id: "createAudioContext",
|
|
22
22
|
src: "audioContext",
|
|
23
23
|
onDone: {
|
|
24
|
-
target: "
|
|
24
|
+
target: "Spawn",
|
|
25
25
|
actions: (0, xstate_1.assign)({ audioContext: ({ event }) => event.output }),
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
|
-
|
|
29
|
+
Spawn: {
|
|
30
30
|
entry: [
|
|
31
31
|
(0, xstate_1.assign)({
|
|
32
32
|
ttsRef: ({ context, spawn }) => {
|
|
@@ -55,68 +55,68 @@ const speechstate = (0, xstate_1.createMachine)({
|
|
|
55
55
|
],
|
|
56
56
|
after: {
|
|
57
57
|
300000: {
|
|
58
|
-
target: "
|
|
58
|
+
target: "Spawn",
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
63
|
},
|
|
64
|
-
|
|
65
|
-
initial: "
|
|
64
|
+
AsrTtsManager: {
|
|
65
|
+
initial: "Initialize",
|
|
66
66
|
on: {
|
|
67
67
|
TTS_READY: {
|
|
68
68
|
actions: () => console.debug("[TTS→SpSt] TTS_READY"),
|
|
69
|
-
target: ".
|
|
69
|
+
target: ".PreReady",
|
|
70
70
|
},
|
|
71
71
|
ASR_READY: {
|
|
72
72
|
actions: () => console.debug("[ASR→SpSt] ASR_READY"),
|
|
73
|
-
target: ".
|
|
73
|
+
target: ".PreReady",
|
|
74
74
|
},
|
|
75
75
|
// ASR_ERROR not implemented
|
|
76
76
|
TTS_ERROR: {
|
|
77
77
|
actions: () => console.error("[TTS→SpSt] TTS_ERROR"),
|
|
78
|
-
target: ".
|
|
78
|
+
target: ".Fail",
|
|
79
79
|
},
|
|
80
80
|
ASR_NOINPUT: {
|
|
81
81
|
actions: [
|
|
82
82
|
() => console.debug("[ASR→SpSt] NOINPUT"),
|
|
83
83
|
(0, xstate_1.sendParent)({ type: "ASR_NOINPUT" }),
|
|
84
84
|
],
|
|
85
|
-
target: ".
|
|
85
|
+
target: ".Ready",
|
|
86
86
|
},
|
|
87
87
|
},
|
|
88
88
|
states: {
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
Initialize: {},
|
|
90
|
+
PreReady: {
|
|
91
91
|
on: {
|
|
92
92
|
TTS_READY: {
|
|
93
93
|
actions: () => console.debug("[TTS→SpSt] TTS_READY"),
|
|
94
|
-
target: "
|
|
94
|
+
target: "Ready",
|
|
95
95
|
},
|
|
96
96
|
ASR_READY: {
|
|
97
97
|
actions: () => console.debug("[ASR→SpSt] ASR_READY"),
|
|
98
|
-
target: "
|
|
98
|
+
target: "Ready",
|
|
99
99
|
},
|
|
100
100
|
},
|
|
101
101
|
},
|
|
102
|
-
|
|
103
|
-
initial: "
|
|
102
|
+
Ready: {
|
|
103
|
+
initial: "Idle",
|
|
104
104
|
entry: [
|
|
105
105
|
() => console.debug("[SpSt] All ready"),
|
|
106
106
|
(0, xstate_1.sendParent)({ type: "ASRTTS_READY" }),
|
|
107
107
|
],
|
|
108
108
|
states: {
|
|
109
|
-
|
|
109
|
+
Idle: {
|
|
110
110
|
on: {
|
|
111
|
-
LISTEN: { target: "
|
|
111
|
+
LISTEN: { target: "WaitForRecogniser" },
|
|
112
112
|
SPEAK: [
|
|
113
113
|
{
|
|
114
|
-
target: "
|
|
114
|
+
target: "Speaking",
|
|
115
115
|
},
|
|
116
116
|
],
|
|
117
117
|
},
|
|
118
118
|
},
|
|
119
|
-
|
|
119
|
+
Speaking: {
|
|
120
120
|
entry: [
|
|
121
121
|
({ event }) => console.debug("[SpSt→TTS] SPEAK", event.value),
|
|
122
122
|
({ context, event }) => context.ttsRef.send({
|
|
@@ -148,7 +148,7 @@ const speechstate = (0, xstate_1.createMachine)({
|
|
|
148
148
|
],
|
|
149
149
|
},
|
|
150
150
|
SPEAK_COMPLETE: {
|
|
151
|
-
target: "
|
|
151
|
+
target: "Idle",
|
|
152
152
|
actions: [
|
|
153
153
|
() => console.debug("[TTS→SpSt] SPEAK_COMPLETE"),
|
|
154
154
|
(0, xstate_1.sendParent)({ type: "SPEAK_COMPLETE" }),
|
|
@@ -156,7 +156,7 @@ const speechstate = (0, xstate_1.createMachine)({
|
|
|
156
156
|
},
|
|
157
157
|
},
|
|
158
158
|
},
|
|
159
|
-
|
|
159
|
+
WaitForRecogniser: {
|
|
160
160
|
entry: [
|
|
161
161
|
({ event }) => console.debug("[SpSt→ASR] START", event.value),
|
|
162
162
|
({ context, event }) => context.asrRef.send({
|
|
@@ -166,7 +166,7 @@ const speechstate = (0, xstate_1.createMachine)({
|
|
|
166
166
|
],
|
|
167
167
|
on: {
|
|
168
168
|
ASR_STARTED: {
|
|
169
|
-
target: "
|
|
169
|
+
target: "Recognising",
|
|
170
170
|
actions: [
|
|
171
171
|
() => console.debug("[ASR→SpSt] ASR_STARTED"),
|
|
172
172
|
(0, xstate_1.sendParent)({ type: "ASR_STARTED" }),
|
|
@@ -174,7 +174,7 @@ const speechstate = (0, xstate_1.createMachine)({
|
|
|
174
174
|
},
|
|
175
175
|
},
|
|
176
176
|
},
|
|
177
|
-
|
|
177
|
+
Recognising: {
|
|
178
178
|
on: {
|
|
179
179
|
CONTROL: {
|
|
180
180
|
actions: [
|
|
@@ -192,13 +192,13 @@ const speechstate = (0, xstate_1.createMachine)({
|
|
|
192
192
|
value: event.value,
|
|
193
193
|
})),
|
|
194
194
|
],
|
|
195
|
-
target: "
|
|
195
|
+
target: "Idle",
|
|
196
196
|
},
|
|
197
197
|
},
|
|
198
198
|
},
|
|
199
199
|
},
|
|
200
200
|
},
|
|
201
|
-
|
|
201
|
+
Fail: {},
|
|
202
202
|
},
|
|
203
203
|
},
|
|
204
204
|
},
|
package/dist/tts.js
CHANGED
|
@@ -125,7 +125,7 @@ exports.ttsMachine = (0, xstate_1.createMachine)({
|
|
|
125
125
|
const ponyfill = (0, TextToSpeech_1.default)({
|
|
126
126
|
audioContext: input.audioContext,
|
|
127
127
|
credentials: {
|
|
128
|
-
region: REGION,
|
|
128
|
+
region: REGION,
|
|
129
129
|
authorizationToken: input.azureAuthorizationToken,
|
|
130
130
|
},
|
|
131
131
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ export interface AzureCredentials {
|
|
|
3
3
|
key: string;
|
|
4
4
|
}
|
|
5
5
|
export interface Settings {
|
|
6
|
-
locale
|
|
6
|
+
locale?: string;
|
|
7
7
|
azureCredentials: string | AzureCredentials;
|
|
8
|
-
asrDefaultCompleteTimeout
|
|
9
|
-
asrDefaultNoInputTimeout
|
|
10
|
-
ttsDefaultVoice
|
|
8
|
+
asrDefaultCompleteTimeout?: number;
|
|
9
|
+
asrDefaultNoInputTimeout?: number;
|
|
10
|
+
ttsDefaultVoice?: string;
|
|
11
11
|
}
|
|
12
12
|
export interface Agenda {
|
|
13
13
|
utterance: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAC5C,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,MAAM;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB"}
|
package/package.json
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
2
|
+
"name": "speechstate",
|
|
3
|
+
"version": "2.0.0-beta.4",
|
|
4
|
+
"license": "GPL-3.0",
|
|
5
|
+
"homepage": "http://localhost/speechstate",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": ["/dist"],
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"microsoft-cognitiveservices-speech-sdk": "^1.31.0",
|
|
11
|
+
"web-speech-cognitive-services": "^7.1.3",
|
|
12
|
+
"xstate": "^5.5.1"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"dev": "vite",
|
|
16
|
+
"test": "jest --silent=false"
|
|
17
|
+
},
|
|
18
|
+
"eslintConfig": {
|
|
19
|
+
"extends": ["react-app", "react-app/jest"]
|
|
20
|
+
},
|
|
21
|
+
"browserslist": {
|
|
22
|
+
"production": [">0.2%", "not dead", "not op_mini all"],
|
|
23
|
+
"development": [
|
|
24
|
+
"last 1 chrome version",
|
|
25
|
+
"last 1 firefox version",
|
|
26
|
+
"last 1 safari version"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/jest": "^29.5.2",
|
|
31
|
+
"@types/webspeechapi": "^0.0.29",
|
|
32
|
+
"buffer": "^5.5.0||^6.0.0",
|
|
33
|
+
"jest": "^29.5.0",
|
|
34
|
+
"jest-environment-jsdom": "^29.5.0",
|
|
35
|
+
"ts-jest": "^29.1.0",
|
|
36
|
+
"typescript": "^5.0.4",
|
|
37
|
+
"vite": "^5.0.11"
|
|
38
|
+
},
|
|
39
|
+
"packageManager": "yarn@3.6.4",
|
|
40
|
+
"description": "* SDK",
|
|
41
|
+
"directories": {
|
|
42
|
+
"doc": "docs",
|
|
43
|
+
"test": "test"
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+ssh://git@github.com/vladmaraev/speechstate.git"
|
|
48
|
+
},
|
|
49
|
+
"author": "Vlad Maraev",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/vladmaraev/speechstate/issues"
|
|
52
|
+
}
|
|
53
53
|
}
|