diff -Nru festival-2.5.0/debian/changelog festival-2.5.0/debian/changelog --- festival-2.5.0/debian/changelog 2018-01-18 21:02:29.000000000 +0000 +++ festival-2.5.0/debian/changelog 2018-04-28 16:09:00.000000000 +0000 @@ -1,3 +1,11 @@ +festival (1:2.5.0-2) unstable; urgency=medium + + * Fix text2wave resampling by resamping *before* counting the number of + samples. (Closes: Bug#890018). + * Bump Standards-Version to 4.1.4 (no changes). + + -- Samuel Thibault Sat, 28 Apr 2018 18:09:00 +0200 + festival (1:2.5.0-1) unstable; urgency=medium * New upstream release diff -Nru festival-2.5.0/debian/control festival-2.5.0/debian/control --- festival-2.5.0/debian/control 2018-01-18 21:02:29.000000000 +0000 +++ festival-2.5.0/debian/control 2018-04-28 14:50:42.000000000 +0000 @@ -15,7 +15,7 @@ texlive-latex-base, quilt, dpkg-dev (>= 1.16.0) -Standards-Version: 4.1.1 +Standards-Version: 4.1.4 Homepage: http://www.cstr.ed.ac.uk/projects/festival/ Vcs-Git: https://anonscm.debian.org/git/tts/festival.git Vcs-Browser: https://anonscm.debian.org/git/tts/festival.git diff -Nru festival-2.5.0/debian/patches/05-performance-combine-waves.diff festival-2.5.0/debian/patches/05-performance-combine-waves.diff --- festival-2.5.0/debian/patches/05-performance-combine-waves.diff 2018-01-18 21:02:29.000000000 +0000 +++ festival-2.5.0/debian/patches/05-performance-combine-waves.diff 2018-02-19 00:42:56.000000000 +0000 @@ -22,6 +22,11 @@ Author: Sergio Oller +--- + examples/text2wave.sh | 58 +++++++++------- + src/arch/festival/wave.cc | 162 +++++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 194 insertions(+), 26 deletions(-) + --- a/examples/text2wave.sh +++ b/examples/text2wave.sh @@ -63,6 +63,8 @@ @@ -46,7 +51,7 @@ (text2wave_help)) -(define (save_record_wave utt) -+ ++ +(define (save_record_wave_fp utt) "Saves the waveform and records its so it can be joined into a a single waveform at the end." @@ -71,17 +76,17 @@ - (utt.wave.rescale wholeutt (parse-number volume)))) - (utt.save.wave wholeutt outfile output_type) - )) ++ (if frequency ++ (utt.wave.resample utt (parse-number frequency)) ++ ) + (if (eq? totalnumsamples 0) -+ (wave.save.header fp (utt.wave utt) output_type nil ++ (wave.save.header fp (utt.wave utt) output_type nil + (list (list "numsamples" 0))) + ) -+ (set! totalnumsamples (+ totalnumsamples ++ (set! totalnumsamples (+ totalnumsamples + (get_param 'num_samples (wave.info (utt.wave utt)) 0) + ) + ) -+ (if frequency -+ (utt.wave.resample utt (parse-number frequency)) -+ ) + (if (not (equal? volume "1.0")) + (begin + (utt.wave.rescale utt (parse-number volume)) @@ -105,7 +110,7 @@ ;; do the synthesis (mapcar (lambda (f) -@@ -168,8 +172,12 @@ +@@ -168,8 +172,12 @@ and delete the intermediate ones." (tts_file f (tts_find_text_mode f auto-text-mode-alist)))) text_files) @@ -113,7 +118,7 @@ - (combine_waves) + ;; Now update the header + (fseek fp 0 0) -+ (wave.save.header fp (utt.wave an_utt) output_type nil ++ (wave.save.header fp (utt.wave an_utt) output_type nil + (list (list "numsamples" totalnumsamples)) + ) + (fclose fp) @@ -130,7 +135,7 @@ #ifdef WIN32 #include "winsock2.h" -@@ -101,6 +102,141 @@ +@@ -101,6 +102,141 @@ static LISP wave_save(LISP lwave,LISP fn return truth; } @@ -139,7 +144,7 @@ + EST_Wave *w = wave(lwave); + EST_String filetype,sampletype; + FILE * fp; -+ ++ + fp = get_c_file(lfp, stdout); + + if (ftype == NIL) @@ -160,7 +165,7 @@ + } + else + sampletype = get_c_string(stype); -+ ++ + if (w->save_file_data(fp,filetype,sampletype,EST_NATIVE_BO) != write_ok) + { + cerr << "utt.save.wave.fp: failed to write wave" << endl; @@ -177,7 +182,7 @@ + EST_Wave *w = wave(lwave); + EST_String filetype,sampletype; + FILE * fp; -+ ++ + fp = get_c_file(lfp, stdout); + + if (ftype == NIL) @@ -198,7 +203,7 @@ + } + else + sampletype = get_c_string(stype); -+ ++ + if (w->save_file(fp,filetype,sampletype,EST_NATIVE_BO) != write_ok) + { + cerr << "utt.save.wave.data.fp: failed to write wave" << endl; @@ -232,12 +237,12 @@ + int num_channels = w->num_channels(); + int sample_rate = w->sample_rate(); + int bo = EST_NATIVE_BO; -+ ++ + num_samples = (int) get_param_float("numsamples", force_values, (float) num_samples); + num_channels = (int) get_param_float("numchannels", force_values, (float) num_channels); + sample_rate = (int) get_param_float("samplerate", force_values, (float) sample_rate); + bo = (int) get_param_float("bo", force_values, (float) bo); -+ ++ + if (lftype == NIL) + { + if (ft_get_param("Wavefiletype")) @@ -247,7 +252,7 @@ + } + else + ftype = get_c_string(lftype); -+ ++ + if (lstype == NIL) + { + if (ft_get_param("Wavesampletype")) @@ -257,22 +262,22 @@ + } + else + stype = get_c_string(lstype); -+ -+ ++ ++ + if (wave_io_save_header(fp, num_samples, num_channels, + sample_rate, stype, bo, ftype) != write_ok) + { + cerr << "utt.save.wave.header: failed" << endl; + festival_error(); + } -+ ++ + return truth; +} + static LISP wave_load(LISP fname,LISP ftype,LISP stype,LISP srate) { EST_Wave *w = new EST_Wave; -@@ -594,7 +730,31 @@ +@@ -594,7 +730,31 @@ static LISP send_sexpr_to_client(LISP l) void festival_wave_init(void) { // declare utterance (wave) specific Lisp functions @@ -293,7 +298,7 @@ + Write WAVE to FILEPOINTER, respecting FILETYPE and SAMPLETYPE if specified\n\ + if these last two arguments are unspecified the global parameters\n\ + Wavefiletype and Wavesampletype are used. Returns t is successful\n\ -+ and throws an error if not."); ++ and throws an error if not."); + init_subr_4("wave.save.data.fp", wave_save_data_fp, + "(wave.save.data.fp WAVE FILEPOINTER FILETYPE SAMPLETYPE)\n\ + Write WAVE to FILEPOINTER, respecting FILETYPE and SAMPLETYPE if specified\n\ @@ -301,7 +306,7 @@ + if these last two arguments are unspecified the global parameters\n\ + Wavefiletype and Wavesampletype are used. Returns t is successful\n\ + and throws an error if not. It can be used with wave.save.header\n\ -+ in order to concatenate several waves."); ++ in order to concatenate several waves."); init_subr_4("wave.save",wave_save, "(wave.save WAVE FILENAME FILETYPE SAMPLETYPE)\n\ Save WAVE in FILENAME, respecting FILETYPE and SAMPLETYPE if specified\n\