johnpaulbin commited on
Commit
0bd32c4
·
verified ·
1 Parent(s): dca1ca2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -87,13 +87,14 @@ def home():
87
 
88
  function clearTranscription() {
89
  liveOutput.textContent = '';
 
90
  }
91
 
92
  // Start and stop functions
93
  document.getElementById('start').addEventListener('click', () => {
94
  recognition.start();
95
- intervalId = setInterval(() => sendTranscriptionToServer(lastTranscription), 600);
96
- setInterval(clearTranscription, 2000); // Clear transcription every 2 seconds
97
  });
98
  document.getElementById('stop').addEventListener('click', () => {
99
  recognition.stop();
 
87
 
88
  function clearTranscription() {
89
  liveOutput.textContent = '';
90
+ currentTranscription = '';
91
  }
92
 
93
  // Start and stop functions
94
  document.getElementById('start').addEventListener('click', () => {
95
  recognition.start();
96
+ intervalId = setInterval(() => sendTranscriptionToServer(lastTranscription), 350);
97
+ setInterval(clearTranscription, 3500); // Clear transcription every 2 seconds
98
  });
99
  document.getElementById('stop').addEventListener('click', () => {
100
  recognition.stop();