Spaces:
Sleeping
Sleeping
Gopikanth123
commited on
Update templates/index.html
Browse files- templates/index.html +130 -18
templates/index.html
CHANGED
@@ -342,7 +342,30 @@
|
|
342 |
<option value="urdu">Urdu</option>
|
343 |
<option value="assamese">Assamese</option>
|
344 |
<option value="sanskrit">Sanskrit</option>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
</select>
|
|
|
346 |
</div>
|
347 |
|
348 |
</div>
|
@@ -367,7 +390,6 @@
|
|
367 |
// Initialize speech recognition
|
368 |
const recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
|
369 |
|
370 |
-
// Function to set language for speech recognition
|
371 |
function setRecognitionLanguage() {
|
372 |
const selectedLanguage = languageSelect.value;
|
373 |
switch (selectedLanguage) {
|
@@ -384,10 +406,33 @@
|
|
384 |
case 'urdu': recognition.lang = 'ur-IN'; break;
|
385 |
case 'assamese': recognition.lang = 'as-IN'; break;
|
386 |
case 'sanskrit': recognition.lang = 'sa-IN'; break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
387 |
case 'english':
|
388 |
default: recognition.lang = 'en-US'; break; // Default to English
|
389 |
}
|
390 |
-
}
|
|
|
391 |
|
392 |
// Event listener for voice input button
|
393 |
voiceBtn.addEventListener('click', () => {
|
@@ -550,51 +595,118 @@
|
|
550 |
let voice;
|
551 |
switch (selectedLanguage.toLowerCase()) {
|
552 |
case 'hindi':
|
553 |
-
voice = 'Hindi Female';
|
554 |
break;
|
555 |
case 'bengali':
|
556 |
-
voice = 'Bengla
|
557 |
break;
|
558 |
case 'telugu':
|
559 |
-
voice = 'Telugu Female';
|
560 |
break;
|
561 |
case 'marathi':
|
562 |
-
voice = 'Marathi Female';
|
563 |
break;
|
564 |
case 'tamil':
|
565 |
-
voice = 'Tamil Female';
|
566 |
break;
|
567 |
case 'gujarati':
|
568 |
-
voice = 'Gujarati Female';
|
569 |
break;
|
570 |
case 'kannada':
|
571 |
-
voice = 'Kannada Female';
|
572 |
break;
|
573 |
case 'malayalam':
|
574 |
-
voice = 'Malayalam Female';
|
575 |
break;
|
576 |
case 'punjabi':
|
577 |
-
voice = 'Punjabi Female';
|
578 |
break;
|
579 |
case 'odia':
|
580 |
-
voice = 'Odia Female';
|
581 |
break;
|
582 |
case 'urdu':
|
583 |
-
voice = 'Urdu Female';
|
584 |
break;
|
585 |
case 'assamese':
|
586 |
-
voice = 'Assamese Female';
|
587 |
break;
|
588 |
case 'sanskrit':
|
589 |
-
voice = 'Sanskrit Female';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
590 |
break;
|
591 |
default:
|
592 |
-
voice = 'UK English
|
593 |
break;
|
594 |
}
|
595 |
|
596 |
-
responsiveVoice.speak(text, voice);
|
597 |
-
}
|
|
|
598 |
|
599 |
// // Test voices and log them
|
600 |
// initializeVoices().then(voices => {
|
|
|
342 |
<option value="urdu">Urdu</option>
|
343 |
<option value="assamese">Assamese</option>
|
344 |
<option value="sanskrit">Sanskrit</option>
|
345 |
+
<option value="arabic">Arabic</option>
|
346 |
+
<option value="australian">Australian English</option>
|
347 |
+
<option value="bangla-india">Bangla (India)</option>
|
348 |
+
<option value="chinese">Chinese</option>
|
349 |
+
<option value="dutch">Dutch</option>
|
350 |
+
<option value="french">French</option>
|
351 |
+
<option value="filipino">Filipino</option>
|
352 |
+
<option value="greek">Greek</option>
|
353 |
+
<option value="indonesian">Indonesian</option>
|
354 |
+
<option value="italian">Italian</option>
|
355 |
+
<option value="japanese">Japanese</option>
|
356 |
+
<option value="korean">Korean</option>
|
357 |
+
<option value="latin">Latin</option>
|
358 |
+
<option value="nepali">Nepali</option>
|
359 |
+
<option value="portuguese">Portuguese</option>
|
360 |
+
<option value="romanian">Romanian</option>
|
361 |
+
<option value="russian">Russian</option>
|
362 |
+
<option value="spanish">Spanish</option>
|
363 |
+
<option value="swedish">Swedish</option>
|
364 |
+
<option value="thai">Thai</option>
|
365 |
+
<option value="ukrainian">Ukrainian</option>
|
366 |
+
<option value="turkish">Turkish</option>
|
367 |
</select>
|
368 |
+
|
369 |
</div>
|
370 |
|
371 |
</div>
|
|
|
390 |
// Initialize speech recognition
|
391 |
const recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
|
392 |
|
|
|
393 |
function setRecognitionLanguage() {
|
394 |
const selectedLanguage = languageSelect.value;
|
395 |
switch (selectedLanguage) {
|
|
|
406 |
case 'urdu': recognition.lang = 'ur-IN'; break;
|
407 |
case 'assamese': recognition.lang = 'as-IN'; break;
|
408 |
case 'sanskrit': recognition.lang = 'sa-IN'; break;
|
409 |
+
case 'arabic': recognition.lang = 'ar-SA'; break;
|
410 |
+
case 'australian': recognition.lang = 'en-AU'; break;
|
411 |
+
case 'bangla-india': recognition.lang = 'bn-IN'; break;
|
412 |
+
case 'chinese': recognition.lang = 'zh-CN'; break;
|
413 |
+
case 'dutch': recognition.lang = 'nl-NL'; break;
|
414 |
+
case 'french': recognition.lang = 'fr-FR'; break;
|
415 |
+
case 'filipino': recognition.lang = 'fil-PH'; break;
|
416 |
+
case 'greek': recognition.lang = 'el-GR'; break;
|
417 |
+
case 'indonesian': recognition.lang = 'id-ID'; break;
|
418 |
+
case 'italian': recognition.lang = 'it-IT'; break;
|
419 |
+
case 'japanese': recognition.lang = 'ja-JP'; break;
|
420 |
+
case 'korean': recognition.lang = 'ko-KR'; break;
|
421 |
+
case 'latin': recognition.lang = 'la'; break;
|
422 |
+
case 'nepali': recognition.lang = 'ne-NP'; break;
|
423 |
+
case 'portuguese': recognition.lang = 'pt-PT'; break;
|
424 |
+
case 'romanian': recognition.lang = 'ro-RO'; break;
|
425 |
+
case 'russian': recognition.lang = 'ru-RU'; break;
|
426 |
+
case 'spanish': recognition.lang = 'es-ES'; break;
|
427 |
+
case 'swedish': recognition.lang = 'sv-SE'; break;
|
428 |
+
case 'thai': recognition.lang = 'th-TH'; break;
|
429 |
+
case 'ukrainian': recognition.lang = 'uk-UA'; break;
|
430 |
+
case 'turkish': recognition.lang = 'tr-TR'; break;
|
431 |
case 'english':
|
432 |
default: recognition.lang = 'en-US'; break; // Default to English
|
433 |
}
|
434 |
+
}
|
435 |
+
|
436 |
|
437 |
// Event listener for voice input button
|
438 |
voiceBtn.addEventListener('click', () => {
|
|
|
595 |
let voice;
|
596 |
switch (selectedLanguage.toLowerCase()) {
|
597 |
case 'hindi':
|
598 |
+
voice = 'Hindi Female';
|
599 |
break;
|
600 |
case 'bengali':
|
601 |
+
voice = 'Bengla India Male';
|
602 |
break;
|
603 |
case 'telugu':
|
604 |
+
voice = 'Telugu Female';
|
605 |
break;
|
606 |
case 'marathi':
|
607 |
+
voice = 'Marathi Female';
|
608 |
break;
|
609 |
case 'tamil':
|
610 |
+
voice = 'Tamil Female';
|
611 |
break;
|
612 |
case 'gujarati':
|
613 |
+
voice = 'Gujarati Female';
|
614 |
break;
|
615 |
case 'kannada':
|
616 |
+
voice = 'Kannada Female';
|
617 |
break;
|
618 |
case 'malayalam':
|
619 |
+
voice = 'Malayalam Female';
|
620 |
break;
|
621 |
case 'punjabi':
|
622 |
+
voice = 'Punjabi Female';
|
623 |
break;
|
624 |
case 'odia':
|
625 |
+
voice = 'Odia Female';
|
626 |
break;
|
627 |
case 'urdu':
|
628 |
+
voice = 'Urdu Female';
|
629 |
break;
|
630 |
case 'assamese':
|
631 |
+
voice = 'Assamese Female';
|
632 |
break;
|
633 |
case 'sanskrit':
|
634 |
+
voice = 'Sanskrit Female';
|
635 |
+
break;
|
636 |
+
case 'arabic':
|
637 |
+
voice = 'Arabic Female';
|
638 |
+
break;
|
639 |
+
case 'australian':
|
640 |
+
voice = 'Australian Female';
|
641 |
+
break;
|
642 |
+
case 'bangla-india':
|
643 |
+
voice = 'Bengla India Male';
|
644 |
+
break;
|
645 |
+
case 'chinese':
|
646 |
+
voice = 'Chinese Female';
|
647 |
+
break;
|
648 |
+
case 'dutch':
|
649 |
+
voice = 'Dutch Female';
|
650 |
+
break;
|
651 |
+
case 'french':
|
652 |
+
voice = 'French Female';
|
653 |
+
break;
|
654 |
+
case 'filipino':
|
655 |
+
voice = 'Filipino Female';
|
656 |
+
break;
|
657 |
+
case 'greek':
|
658 |
+
voice = 'Greek Female';
|
659 |
+
break;
|
660 |
+
case 'indonesian':
|
661 |
+
voice = 'Indonesian Female';
|
662 |
+
break;
|
663 |
+
case 'italian':
|
664 |
+
voice = 'Italian Female';
|
665 |
+
break;
|
666 |
+
case 'japanese':
|
667 |
+
voice = 'Japanese Female';
|
668 |
+
break;
|
669 |
+
case 'korean':
|
670 |
+
voice = 'Korean Female';
|
671 |
+
break;
|
672 |
+
case 'latin':
|
673 |
+
voice = 'Latin Male';
|
674 |
+
break;
|
675 |
+
case 'nepali':
|
676 |
+
voice = 'Nepali';
|
677 |
+
break;
|
678 |
+
case 'portuguese':
|
679 |
+
voice = 'Portuguese Female';
|
680 |
+
break;
|
681 |
+
case 'romanian':
|
682 |
+
voice = 'Romanian Female';
|
683 |
+
break;
|
684 |
+
case 'russian':
|
685 |
+
voice = 'Russian Female';
|
686 |
+
break;
|
687 |
+
case 'spanish':
|
688 |
+
voice = 'Spanish Female';
|
689 |
+
break;
|
690 |
+
case 'swedish':
|
691 |
+
voice = 'Swedish Female';
|
692 |
+
break;
|
693 |
+
case 'thai':
|
694 |
+
voice = 'Thai Female';
|
695 |
+
break;
|
696 |
+
case 'ukrainian':
|
697 |
+
voice = 'Ukrainian Female';
|
698 |
+
break;
|
699 |
+
case 'turkish':
|
700 |
+
voice = 'Turkish Female';
|
701 |
break;
|
702 |
default:
|
703 |
+
voice = 'UK English Female';
|
704 |
break;
|
705 |
}
|
706 |
|
707 |
+
responsiveVoice.speak(text, voice);
|
708 |
+
}
|
709 |
+
|
710 |
|
711 |
// // Test voices and log them
|
712 |
// initializeVoices().then(voices => {
|