[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#594872: espeak: hungarian language phoneme is full broken and unusable



Hello,

Could you check that the attached patch fixes it?

Samuel
diff --git a/platforms/big_endian/espeak-phoneme-data.c b/platforms/big_endian/espeak-phoneme-data.c
index 2a8dd22..815fdd4 100644
--- a/platforms/big_endian/espeak-phoneme-data.c
+++ b/platforms/big_endian/espeak-phoneme-data.c
@@ -286,6 +286,24 @@ void swap_phondata  (const char *infile, const char *outfile,
             xread = fread (env_buf, 1, 128, in);
             fwrite (env_buf, 1, 128, out);
         }
+        else if (line[0] == 'Q') {
+            unsigned char pb[4];
+            unsigned length;
+            char *buf;
+
+            xread = fread (pb, 1, 4, in);
+            fwrite (pb, 1, 4, out);
+
+            length = (pb[2] << 8) + pb[3]; // size in words
+            length *= 4;
+
+            buf = (char *) malloc (length);
+
+            xread = fread (buf, length, 1, in);
+            fwrite (buf, length, 1, out);
+
+            free (buf);
+        }
     }
 
     fclose (in);

Reply to: