Gopikanth123 commited on
Commit
d86d511
·
verified ·
1 Parent(s): a9f7aa6

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +35 -114
templates/index.html CHANGED
@@ -595,122 +595,43 @@
595
  // }
596
 
597
  // Language Handling Function
598
- function speakResponse(text, selectedLanguage) {
599
- let voice;
600
- switch (selectedLanguage.toLowerCase()) {
601
- case 'hindi':
602
- voice = 'Hindi Female';
603
- break;
604
- case 'bengali':
605
- voice = 'Bengla India Male';
606
- break;
607
- case 'telugu':
608
- voice = 'Telugu Female';
609
- break;
610
- case 'marathi':
611
- voice = 'Marathi Female';
612
- break;
613
- case 'tamil':
614
- voice = 'Tamil Female';
615
- break;
616
- case 'gujarati':
617
- voice = 'Gujarati Female';
618
- break;
619
- case 'kannada':
620
- voice = 'Kannada Female';
621
- break;
622
- case 'malayalam':
623
- voice = 'Malayalam Female';
624
- break;
625
- case 'punjabi':
626
- voice = 'Punjabi Female';
627
- break;
628
- case 'odia':
629
- voice = 'Odia Female';
630
- break;
631
- case 'urdu':
632
- voice = 'Urdu Female';
633
- break;
634
- case 'assamese':
635
- voice = 'Assamese Female';
636
- break;
637
- case 'sanskrit':
638
- voice = 'Sanskrit Female';
639
- break;
640
- case 'arabic':
641
- voice = 'Arabic Female';
642
- break;
643
- case 'australian':
644
- voice = 'Australian Female';
645
- break;
646
- case 'bangla-india':
647
- voice = 'Bengla India Male';
648
- break;
649
- case 'chinese':
650
- voice = 'Chinese Female';
651
- break;
652
- case 'dutch':
653
- voice = 'Dutch Female';
654
- break;
655
- case 'french':
656
- voice = 'French Female';
657
- break;
658
- case 'filipino':
659
- voice = 'Filipino Female';
660
- break;
661
- case 'greek':
662
- voice = 'Greek Female';
663
- break;
664
- case 'indonesian':
665
- voice = 'Indonesian Female';
666
- break;
667
- case 'italian':
668
- voice = 'Italian Female';
669
- break;
670
- case 'japanese':
671
- voice = 'Japanese Female';
672
- break;
673
- case 'korean':
674
- voice = 'Korean Female';
675
- break;
676
- case 'latin':
677
- voice = 'Latin Male';
678
- break;
679
- case 'nepali':
680
- voice = 'Nepali';
681
- break;
682
- case 'portuguese':
683
- voice = 'Portuguese Female';
684
- break;
685
- case 'romanian':
686
- voice = 'Romanian Female';
687
- break;
688
- case 'russian':
689
- voice = 'Russian Female';
690
- break;
691
- case 'spanish':
692
- voice = 'Spanish Female';
693
- break;
694
- case 'swedish':
695
- voice = 'Swedish Female';
696
- break;
697
- case 'thai':
698
- voice = 'Thai Female';
699
- break;
700
- case 'ukrainian':
701
- voice = 'Ukrainian Female';
702
- break;
703
- case 'turkish':
704
- voice = 'Turkish Female';
705
- break;
706
- default:
707
- voice = 'UK English Female';
708
- break;
709
- }
710
 
711
- responsiveVoice.speak(text);
712
-
 
 
 
 
 
 
 
 
713
  }
 
714
 
715
 
716
  // // Test voices and log them
 
595
  // }
596
 
597
  // Language Handling Function
598
+ function speakResponse(text, selectedLanguage) {
599
+ // Dictionary mapping specified languages to their respective voices
600
+ const languageVoiceMap = {
601
+ hindi: 'Hindi Female',
602
+ tamil: 'Tamil Female',
603
+ arabic: 'Arabic Female',
604
+ chinese: 'Chinese Female',
605
+ dutch: 'Dutch Female',
606
+ french: 'French Female',
607
+ filipino: 'Filipino Female',
608
+ greek: 'Greek Female',
609
+ indonesian: 'Indonesian Female',
610
+ italian: 'Italian Female',
611
+ japanese: 'Japanese Female',
612
+ korean: 'Korean Female',
613
+ portuguese: 'Portuguese Female',
614
+ romanian: 'Romanian Female',
615
+ russian: 'Russian Female',
616
+ spanish: 'Spanish Female',
617
+ swedish: 'Swedish Female',
618
+ thai: 'Thai Female',
619
+ ukrainian: 'Ukrainian Female',
620
+ turkish: 'Turkish Female'
621
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
622
 
623
+ // Get the voice for the selected language
624
+ const voice = languageVoiceMap[selectedLanguage.toLowerCase()];
625
+
626
+ // Check if the language has a specified voice
627
+ if (voice) {
628
+ responsiveVoice.speak(text, voice);
629
+ } else {
630
+ // Use default behavior for unspecified languages
631
+ responsiveVoice.speak(text);
632
+ }
633
  }
634
+
635
 
636
 
637
  // // Test voices and log them