lokesh341 commited on
Commit
22299d1
·
verified ·
1 Parent(s): 09bbf0e

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +16 -3
templates/index.html CHANGED
@@ -120,14 +120,27 @@
120
  emailCaptured = event.results[0][0].transcript.trim().replace(/\bat\b/g, '@').replace(/\s+/g, '');
121
  document.getElementById('email').value = emailCaptured;
122
  recognition.stop();
123
- speak("Your registration is complete. Thank you for registering.");
124
- setTimeout(() => location.reload(), 20000);
 
 
 
 
 
 
 
 
 
 
 
125
  };
126
  }
127
 
128
  function startProcess() {
129
  speak("Welcome to Biryani Hub", function() {
130
- speak("Tell me your name, and I will confirm it with you.", startListeningForName);
 
 
131
  });
132
  }
133
 
 
120
  emailCaptured = event.results[0][0].transcript.trim().replace(/\bat\b/g, '@').replace(/\s+/g, '');
121
  document.getElementById('email').value = emailCaptured;
122
  recognition.stop();
123
+ speak("You said " + emailCaptured + ". Is it correct?", function() {
124
+ recognition.start();
125
+ recognition.onresult = function(event) {
126
+ let confirmation = event.results[0][0].transcript.trim().toLowerCase();
127
+ recognition.stop();
128
+ if (confirmation.includes("ok") || confirmation.includes("yes")) {
129
+ speak("Your registration is complete. Thank you for registering.");
130
+ setTimeout(() => location.reload(), 20000);
131
+ } else {
132
+ speak("Let's try again. Tell me your email.", startListeningForEmail);
133
+ }
134
+ };
135
+ });
136
  };
137
  }
138
 
139
  function startProcess() {
140
  speak("Welcome to Biryani Hub", function() {
141
+ speak("Tell me your name, and I will confirm it with you.", function() {
142
+ setTimeout(startListeningForName, 500);
143
+ });
144
  });
145
  }
146