aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-multimedia/hts_engine/hts-engine/nomalize.patch31
-rw-r--r--[-rwxr-xr-x]recipes-multimedia/hts_engine/hts-engine_1.10.bb4
2 files changed, 34 insertions, 1 deletions
diff --git a/recipes-multimedia/hts_engine/hts-engine/nomalize.patch b/recipes-multimedia/hts_engine/hts-engine/nomalize.patch
new file mode 100644
index 000000000..e292fbb1c
--- /dev/null
+++ b/recipes-multimedia/hts_engine/hts-engine/nomalize.patch
@@ -0,0 +1,31 @@
+diff --git a/lib/HTS_engine.c b/lib/HTS_engine.c
+old mode 100644
+new mode 100755
+index 5325426..b507226
+--- a/lib/HTS_engine.c
++++ b/lib/HTS_engine.c
+@@ -733,6 +733,9 @@ void HTS_Engine_save_riff(HTS_Engine * engine, FILE * fp)
+ HTS_fwrite_little_endian(data_37_40, sizeof(char), 4, fp);
+ HTS_fwrite_little_endian(&data_41_44, sizeof(int), 1, fp);
+ /* write data */
++
++ short peak = 0;
++
+ for (i = 0; i < HTS_GStreamSet_get_total_nsamples(gss); i++) {
+ x = HTS_GStreamSet_get_speech(gss, i);
+ if (x > 32767.0)
+@@ -741,6 +744,14 @@ void HTS_Engine_save_riff(HTS_Engine * engine, FILE * fp)
+ temp = -32768;
+ else
+ temp = (short) x;
++ short sample = abs(temp);
++ if(peak < sample)
++ peak = sample;
++ }
++ float mul = (32767.0f / peak);
++ for (i = 0; i < HTS_GStreamSet_get_total_nsamples(gss); i++) {
++ x = HTS_GStreamSet_get_speech(gss, i);
++ temp = ((short) x) * mul;
+ HTS_fwrite_little_endian(&temp, sizeof(short), 1, fp);
+ }
+ }
diff --git a/recipes-multimedia/hts_engine/hts-engine_1.10.bb b/recipes-multimedia/hts_engine/hts-engine_1.10.bb
index 3522f666a..ed5cae63c 100755..100644
--- a/recipes-multimedia/hts_engine/hts-engine_1.10.bb
+++ b/recipes-multimedia/hts_engine/hts-engine_1.10.bb
@@ -12,7 +12,9 @@ BBCLASSEXTEND = "native"
S = "${WORKDIR}/hts_engine_API-${PV}"
-SRC_URI = "http://downloads.sourceforge.net/hts-engine/hts_engine_API-${PV}.tar.gz"
+SRC_URI = "http://downloads.sourceforge.net/hts-engine/hts_engine_API-${PV}.tar.gz \
+ file://nomalize.patch \
+ "
SRC_URI[md5sum] = "5626d1e2522659e93fb295f0b42339f5"
SRC_URI[sha256sum] = "e2132be5860d8fb4a460be766454cfd7c3e21cf67b509c48e1804feab14968f7"