@nualang/nualang-ui-components 0.1.1149 → 0.1.1150
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/Exercises/Pronouncer/Pronouncer.js +1 -1
- package/dist/Exercises/Roleplay/Games/ActItOutGameListeningAndSpeaking/ActItOutGame.js +1 -1
- package/dist/Exercises/Roleplay/Games/ActItOutGameSpeaking/ActItOutGame.js +1 -1
- package/dist/Tables/Progress/ProgressTable.js +1 -1
- package/dist/hooks/useRecognition.js +8 -9
- package/package.json +1 -1
|
@@ -448,7 +448,7 @@ function RoleplayGame({
|
|
|
448
448
|
}, [actorHasBeenSelected]);
|
|
449
449
|
const nextScriptLine = roleplay && scriptWithoutQuestions && scriptWithoutQuestions[roleplayMessages.length] ? scriptWithoutQuestions[roleplayMessages.length] : "";
|
|
450
450
|
(0, _react.useEffect)(() => {
|
|
451
|
-
if (nextScriptLine) {
|
|
451
|
+
if (nextScriptLine?.text) {
|
|
452
452
|
setCurrentPhraseText(nextScriptLine.text);
|
|
453
453
|
}
|
|
454
454
|
}, [nextScriptLine]);
|
|
@@ -446,7 +446,7 @@ function RoleplayGame({
|
|
|
446
446
|
}, [actorHasBeenSelected]);
|
|
447
447
|
const nextScriptLine = roleplay && scriptWithoutQuestions && scriptWithoutQuestions[roleplayMessages.length] ? scriptWithoutQuestions[roleplayMessages.length] : "";
|
|
448
448
|
(0, _react.useEffect)(() => {
|
|
449
|
-
if (nextScriptLine) {
|
|
449
|
+
if (nextScriptLine?.text) {
|
|
450
450
|
setCurrentPhraseText(nextScriptLine.text);
|
|
451
451
|
}
|
|
452
452
|
}, [nextScriptLine]);
|
|
@@ -40,13 +40,14 @@ const constraints = {
|
|
|
40
40
|
audio: true,
|
|
41
41
|
video: false
|
|
42
42
|
};
|
|
43
|
-
function useRecognition({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
function useRecognition(props = {}) {
|
|
44
|
+
const {
|
|
45
|
+
currentPhraseText,
|
|
46
|
+
trackRecommendedEvent,
|
|
47
|
+
learnLang,
|
|
48
|
+
exerciseName,
|
|
49
|
+
gameId
|
|
50
|
+
} = props;
|
|
50
51
|
const browserSupportsSpeechRecognition = true;
|
|
51
52
|
const [recognitionState, setRecognitionState] = (0, _react.useState)({
|
|
52
53
|
interimTranscript: "",
|
|
@@ -202,7 +203,6 @@ function useRecognition({
|
|
|
202
203
|
A8_learn_language: `${learnLang}`,
|
|
203
204
|
A9_exercise: gameId ? `${exerciseName}-${gameId}` : `${exerciseName}`
|
|
204
205
|
};
|
|
205
|
-
console.log("Event Body:", eventBody);
|
|
206
206
|
trackRecommendedEvent("speech_recognition_no_transcript", eventBody);
|
|
207
207
|
};
|
|
208
208
|
const stopRecording = (keepSocketAlive, triggerEvent) => {
|
|
@@ -225,7 +225,6 @@ function useRecognition({
|
|
|
225
225
|
} = recognitionState;
|
|
226
226
|
if (triggerEvent && (!finalTranscript || finalTranscript === "") && (!interimTranscript || interimTranscript === "")) {
|
|
227
227
|
captureSpeechRecognitionNoTranscript().catch(console.error);
|
|
228
|
-
console.log("Event triggered");
|
|
229
228
|
}
|
|
230
229
|
}, 2000);
|
|
231
230
|
};
|