@dreamtree-org/twreact-ui 1.1.32 → 1.1.33
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/components/core/SpeechToText.d.ts.map +1 -1
- package/dist/index.esm.js +10 -5
- package/dist/index.js +10 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpeechToText.d.ts","sourceRoot":"","sources":["../../../src/components/core/SpeechToText.jsx"],"names":[],"mappings":";AAcA,
|
|
1
|
+
{"version":3,"file":"SpeechToText.d.ts","sourceRoot":"","sources":["../../../src/components/core/SpeechToText.jsx"],"names":[],"mappings":";AAcA,sFA2OE;kBAlPK,OAAO"}
|
package/dist/index.esm.js
CHANGED
|
@@ -16245,6 +16245,7 @@ var SpeechToText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
16245
16245
|
if (!isMountedRef.current) return;
|
|
16246
16246
|
setIsListening(true);
|
|
16247
16247
|
setError(null);
|
|
16248
|
+
console.log("debuggin is oned");
|
|
16248
16249
|
onStart();
|
|
16249
16250
|
};
|
|
16250
16251
|
recognition.onresult = function (event) {
|
|
@@ -16257,6 +16258,7 @@ var SpeechToText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
16257
16258
|
var text = ((_res$ = res[0]) === null || _res$ === void 0 ? void 0 : _res$.transcript) || "";
|
|
16258
16259
|
if (res.isFinal) {
|
|
16259
16260
|
finalChunk += text + " ";
|
|
16261
|
+
finalTranscriptRef.current += text + " ";
|
|
16260
16262
|
} else {
|
|
16261
16263
|
interim += text;
|
|
16262
16264
|
}
|
|
@@ -16273,11 +16275,14 @@ var SpeechToText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
16273
16275
|
recognition.onend = function () {
|
|
16274
16276
|
if (!isMountedRef.current) return;
|
|
16275
16277
|
setIsListening(false);
|
|
16276
|
-
|
|
16277
|
-
if (
|
|
16278
|
-
|
|
16279
|
-
|
|
16280
|
-
|
|
16278
|
+
buildFinalTranscript();
|
|
16279
|
+
// if (
|
|
16280
|
+
// finalTranscript &&
|
|
16281
|
+
// finalTranscript !== lastEmittedFinalRef.current
|
|
16282
|
+
// ) {
|
|
16283
|
+
// lastEmittedFinalRef.current = finalTranscript;
|
|
16284
|
+
// onSpeechComplete(finalTranscript);
|
|
16285
|
+
// }
|
|
16281
16286
|
onStop();
|
|
16282
16287
|
};
|
|
16283
16288
|
recognitionRef.current = recognition;
|
package/dist/index.js
CHANGED
|
@@ -16265,6 +16265,7 @@ var SpeechToText = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
16265
16265
|
if (!isMountedRef.current) return;
|
|
16266
16266
|
setIsListening(true);
|
|
16267
16267
|
setError(null);
|
|
16268
|
+
console.log("debuggin is oned");
|
|
16268
16269
|
onStart();
|
|
16269
16270
|
};
|
|
16270
16271
|
recognition.onresult = function (event) {
|
|
@@ -16277,6 +16278,7 @@ var SpeechToText = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
16277
16278
|
var text = ((_res$ = res[0]) === null || _res$ === void 0 ? void 0 : _res$.transcript) || "";
|
|
16278
16279
|
if (res.isFinal) {
|
|
16279
16280
|
finalChunk += text + " ";
|
|
16281
|
+
finalTranscriptRef.current += text + " ";
|
|
16280
16282
|
} else {
|
|
16281
16283
|
interim += text;
|
|
16282
16284
|
}
|
|
@@ -16293,11 +16295,14 @@ var SpeechToText = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
16293
16295
|
recognition.onend = function () {
|
|
16294
16296
|
if (!isMountedRef.current) return;
|
|
16295
16297
|
setIsListening(false);
|
|
16296
|
-
|
|
16297
|
-
if (
|
|
16298
|
-
|
|
16299
|
-
|
|
16300
|
-
|
|
16298
|
+
buildFinalTranscript();
|
|
16299
|
+
// if (
|
|
16300
|
+
// finalTranscript &&
|
|
16301
|
+
// finalTranscript !== lastEmittedFinalRef.current
|
|
16302
|
+
// ) {
|
|
16303
|
+
// lastEmittedFinalRef.current = finalTranscript;
|
|
16304
|
+
// onSpeechComplete(finalTranscript);
|
|
16305
|
+
// }
|
|
16301
16306
|
onStop();
|
|
16302
16307
|
};
|
|
16303
16308
|
recognitionRef.current = recognition;
|