@contentgrowth/llm-service 0.9.6 → 0.9.7
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.
|
@@ -217,7 +217,6 @@ var useSpeechRecognition = (onResult, onEnd, language = "en-US") => {
|
|
|
217
217
|
const recognition = new SpeechRecognition();
|
|
218
218
|
recognition.continuous = true;
|
|
219
219
|
recognition.interimResults = true;
|
|
220
|
-
recognition.lang = language;
|
|
221
220
|
recognition.onstart = () => {
|
|
222
221
|
setIsListening(true);
|
|
223
222
|
setError(null);
|
|
@@ -278,6 +277,11 @@ var useSpeechRecognition = (onResult, onEnd, language = "en-US") => {
|
|
|
278
277
|
recognitionRef.current.stop();
|
|
279
278
|
}
|
|
280
279
|
};
|
|
280
|
+
}, []);
|
|
281
|
+
(0, import_react2.useEffect)(() => {
|
|
282
|
+
if (recognitionRef.current) {
|
|
283
|
+
recognitionRef.current.lang = language;
|
|
284
|
+
}
|
|
281
285
|
}, [language]);
|
|
282
286
|
const start = (0, import_react2.useCallback)(() => {
|
|
283
287
|
if (recognitionRef.current && !isListening) {
|