Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -75,6 +75,12 @@ def home():
|
|
75 |
|
76 |
recognition.onerror = (event) => {
|
77 |
console.error('Speech recognition error', event.error);
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
};
|
79 |
|
80 |
function sendTranscriptionToServer(transcription) {
|
|
|
75 |
|
76 |
recognition.onerror = (event) => {
|
77 |
console.error('Speech recognition error', event.error);
|
78 |
+
recognition.start();
|
79 |
+
};
|
80 |
+
|
81 |
+
recognition.onend = () => {
|
82 |
+
// Automatically restart the recognition when it ends
|
83 |
+
recognition.start();
|
84 |
};
|
85 |
|
86 |
function sendTranscriptionToServer(transcription) {
|