Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

genlang: More voice-related fixes.

* Use consistent ID numbering
* Use consistent logic for voicelist and voicebin files
* Fix situations where English <-> English would fail in strange ways
* Delete leftover tmpfile.
* Off-by-one error in voice validation code
* Off-by-one error in voicelist generation

Change-Id: Ib3cea2c6612138b1cbe614dacbe51000199cc9ad

+22 -50
+1 -1
apps/lang/lang.make
··· 51 51 $(SILENT)mkdir -p $(dir $@) 52 52 $(SILENT)$(TOOLSDIR)/genlang -u -e=$(APPSDIR)/lang/english.lang $< > $@.tmp 53 53 $(SILENT)$(TOOLSDIR)/genlang -e=$(APPSDIR)/lang/english.lang -t=$(MODELNAME):`cat $(BUILDDIR)/apps/genlang-features` -i=$(TARGET_ID) -b=$*.lng -c=$*.vstrings $@.tmp 54 - $(SILENT)rm -f $<.tmp 54 + $(SILENT)rm -f $@.tmp 55 55 56 56 $(BUILDDIR)/apps/lang/voicestrings.zip: $(VOICEOBJ) 57 57 $(call PRINTS,ZIP $(subst $(BUILDDIR)/,,$@))
+1 -1
apps/talk.c
··· 624 624 if (voicefile.version == VOICE_VERSION && 625 625 voicefile.target_id == TARGET_ID && 626 626 voicefile.id1_max == TALK_FINAL_ID && 627 - voicefile.id2_max == TALK_FINAL_ID_VOICEONLY - VOICEONLY_DELIMITER) 627 + voicefile.id2_max == TALK_FINAL_ID_VOICEONLY - VOICEONLY_DELIMITER - 1) 628 628 { 629 629 if (load_index_table(fd, &voicefile)) 630 630 return true;
+20 -48
tools/genlang
··· 794 794 # loop over the target phrases 795 795 # This loops over the strings in the translated language file order 796 796 my @ids = ((0 .. ($idcount[$_]-1))); 797 - push @ids, (0x8000 .. ($voiceid[$_]-1)); 797 + push @ids, (0x8001 .. ($voiceid[$_]-1)); 798 798 for $n (@ids) { 799 799 my $name=$idnum[$_][$n]; # get the ID 800 800 my $dest = $dest{$name}; # get the destination phrase ··· 829 829 830 830 my @engl; 831 831 832 - # This loops over the strings in the translated language file order 833 - my @ids = ((0 .. ($idcount[$users{"core"}]-1))); 834 - push @ids, (0x8000 .. ($voiceid[$users{"core"}]-1)); 835 - 836 - #for my $id (@ids) { 837 - # print "$id\n"; 838 - #} 839 - 840 - for $i (@ids) { 841 - my $name=$idnum[$users{"core"}][$i]; # get the ID 842 - my $dest = $voice{$name}; # get the destination voice string 843 - 844 - if($dest) { 845 - $dest =~ s/^\"(.*)\"\s*$/$1/g; # cut off quotes 846 - 847 - # Now, make sure we get the number from the english sort order: 848 - $idnum = $idmap[$users{"core"}]{$name}; 849 - 850 - if(length($idnum)) { 851 - $engl[$idnum] = $i; 832 + for (keys %users) { 833 + # loop over the target phrases 834 + # This loops over the strings in the translated language file order 835 + my @ids = ((0 .. ($idcount[$_]-1))); 836 + push @ids, (0x8001 .. ($voiceid[$_]-1)); 837 + for $n (@ids) { 838 + my $name=$idnum[$_][$n]; # get the ID 839 + my $dest = $dest{$name}; # get the destination phrase 840 + my $voice = $voice{$name}; # get the destination voice string 852 841 853 - #print "Input index $i output index $idnum\n"; 854 - } 855 - else { 856 - # not used, mark it so 857 - $engl[$i] = -1 842 + if($voice) { 843 + $voice =~ s/^\"(.*)\"\s*$/$1/g; # cut off quotes 844 + # Now, make sure we get the number from the english sort order: 845 + $idnum = $idmap[$_]{$name}; 846 + $engl[$idnum] = "#$idnum ($n)\nid: $name\nvoice: \"$voice\"\n"; 858 847 } 859 - 860 848 } 861 849 } 862 - for my $i (@ids) { 863 - 864 - my $o = $engl[$i]; 865 - 866 - if(($o < 0) || !length($o)) { 867 - if($i < 0x8000) { 868 - print "#$i\nid: NOT_USED_$i\nvoice: \"\"\n"; 869 - } 870 - else { 871 - print "#$i\nid: VOICE_NOT_USED_$i\nvoice: \"\"\n"; 872 - } 873 - next; 874 - } 875 - 876 - my $name=$idnum[$users{"core"}][$o]; # get the ID 877 - my $dest = $voice{$name}; # get the destination voice string 878 - 879 - print "#$i ($o)\nid: $name\nvoice: $dest\n"; 850 + # Print the list in the the English sort order 851 + for (@engl) { 852 + print $_; 880 853 } 881 - 882 854 } 883 855 884 856 885 857 if($verbose) { 886 858 my $num_str = 0; 887 - 859 + 888 860 for (keys %users) { 889 861 $num_str += $idcount[$_]; 890 862 } 891 - 863 + 892 864 printf("%d ID strings scanned\n", $num_str); 893 865 894 866 print "* head *\n";