diff options
-rw-r--r-- | apps/lang/lang.make | 2 | ||||
-rw-r--r-- | apps/talk.c | 2 | ||||
-rwxr-xr-x | tools/genlang | 68 |
3 files changed, 22 insertions, 50 deletions
diff --git a/apps/lang/lang.make b/apps/lang/lang.make index b705ff9d0d..08cec5090a 100644 --- a/apps/lang/lang.make +++ b/apps/lang/lang.make | |||
@@ -51,7 +51,7 @@ $(BUILDDIR)/%.lng $(BUILDDIR)/%.vstrings: $(ROOTDIR)/%.lang $(BUILDDIR)/apps/gen | |||
51 | $(SILENT)mkdir -p $(dir $@) | 51 | $(SILENT)mkdir -p $(dir $@) |
52 | $(SILENT)$(TOOLSDIR)/genlang -u -e=$(APPSDIR)/lang/english.lang $< > $@.tmp | 52 | $(SILENT)$(TOOLSDIR)/genlang -u -e=$(APPSDIR)/lang/english.lang $< > $@.tmp |
53 | $(SILENT)$(TOOLSDIR)/genlang -e=$(APPSDIR)/lang/english.lang -t=$(MODELNAME):`cat $(BUILDDIR)/apps/genlang-features` -i=$(TARGET_ID) -b=$*.lng -c=$*.vstrings $@.tmp | 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 | $(BUILDDIR)/apps/lang/voicestrings.zip: $(VOICEOBJ) | 56 | $(BUILDDIR)/apps/lang/voicestrings.zip: $(VOICEOBJ) |
57 | $(call PRINTS,ZIP $(subst $(BUILDDIR)/,,$@)) | 57 | $(call PRINTS,ZIP $(subst $(BUILDDIR)/,,$@)) |
diff --git a/apps/talk.c b/apps/talk.c index 2d27f7a399..d38432de7c 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -624,7 +624,7 @@ static bool load_voicefile_index(int fd) | |||
624 | if (voicefile.version == VOICE_VERSION && | 624 | if (voicefile.version == VOICE_VERSION && |
625 | voicefile.target_id == TARGET_ID && | 625 | voicefile.target_id == TARGET_ID && |
626 | voicefile.id1_max == TALK_FINAL_ID && | 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 | if (load_index_table(fd, &voicefile)) | 629 | if (load_index_table(fd, &voicefile)) |
630 | return true; | 630 | return true; |
diff --git a/tools/genlang b/tools/genlang index a5f62bf3ca..e943492067 100755 --- a/tools/genlang +++ b/tools/genlang | |||
@@ -794,7 +794,7 @@ elsif($binary || $binvoice) { | |||
794 | # loop over the target phrases | 794 | # loop over the target phrases |
795 | # This loops over the strings in the translated language file order | 795 | # This loops over the strings in the translated language file order |
796 | my @ids = ((0 .. ($idcount[$_]-1))); | 796 | my @ids = ((0 .. ($idcount[$_]-1))); |
797 | push @ids, (0x8000 .. ($voiceid[$_]-1)); | 797 | push @ids, (0x8001 .. ($voiceid[$_]-1)); |
798 | for $n (@ids) { | 798 | for $n (@ids) { |
799 | my $name=$idnum[$_][$n]; # get the ID | 799 | my $name=$idnum[$_][$n]; # get the ID |
800 | my $dest = $dest{$name}; # get the destination phrase | 800 | my $dest = $dest{$name}; # get the destination phrase |
@@ -829,66 +829,38 @@ elsif($voiceout) { | |||
829 | 829 | ||
830 | my @engl; | 830 | my @engl; |
831 | 831 | ||
832 | # This loops over the strings in the translated language file order | 832 | for (keys %users) { |
833 | my @ids = ((0 .. ($idcount[$users{"core"}]-1))); | 833 | # loop over the target phrases |
834 | push @ids, (0x8000 .. ($voiceid[$users{"core"}]-1)); | 834 | # This loops over the strings in the translated language file order |
835 | 835 | my @ids = ((0 .. ($idcount[$_]-1))); | |
836 | #for my $id (@ids) { | 836 | push @ids, (0x8001 .. ($voiceid[$_]-1)); |
837 | # print "$id\n"; | 837 | for $n (@ids) { |
838 | #} | 838 | my $name=$idnum[$_][$n]; # get the ID |
839 | 839 | my $dest = $dest{$name}; # get the destination phrase | |
840 | for $i (@ids) { | 840 | my $voice = $voice{$name}; # get the destination voice string |
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; | ||
852 | 841 | ||
853 | #print "Input index $i output index $idnum\n"; | 842 | if($voice) { |
854 | } | 843 | $voice =~ s/^\"(.*)\"\s*$/$1/g; # cut off quotes |
855 | else { | 844 | # Now, make sure we get the number from the english sort order: |
856 | # not used, mark it so | 845 | $idnum = $idmap[$_]{$name}; |
857 | $engl[$i] = -1 | 846 | $engl[$idnum] = "#$idnum ($n)\nid: $name\nvoice: \"$voice\"\n"; |
858 | } | 847 | } |
859 | |||
860 | } | 848 | } |
861 | } | 849 | } |
862 | for my $i (@ids) { | 850 | # Print the list in the the English sort order |
863 | 851 | for (@engl) { | |
864 | my $o = $engl[$i]; | 852 | print $_; |
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"; | ||
880 | } | 853 | } |
881 | |||
882 | } | 854 | } |
883 | 855 | ||
884 | 856 | ||
885 | if($verbose) { | 857 | if($verbose) { |
886 | my $num_str = 0; | 858 | my $num_str = 0; |
887 | 859 | ||
888 | for (keys %users) { | 860 | for (keys %users) { |
889 | $num_str += $idcount[$_]; | 861 | $num_str += $idcount[$_]; |
890 | } | 862 | } |
891 | 863 | ||
892 | printf("%d ID strings scanned\n", $num_str); | 864 | printf("%d ID strings scanned\n", $num_str); |
893 | 865 | ||
894 | print "* head *\n"; | 866 | print "* head *\n"; |