praat / praat

Praat: Doing Phonetics By Computer

Home Page:http://www.praat.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong output for "Create SpeechSynthesizer" in Praat 6.3.15

rlaboiss opened this issue · comments

In a Debian system, this simple script:

ss = Create SpeechSynthesizer: "English (Great Britain)", "Male1"
text$ = "text"
phonemes$ = Get phonemes from text: text$
appendInfoLine: "phonemes = ", phonemes$

worked fine with Praat 6.3.14:

$ praat_nogui /var/tmp/test.praat
phonemes = tɛkst 

However, with version 6.3.15 of Praat, it yields random Chinese characters instead of a string of IPA characters:

$ for i in {1..5} ; do ./praat_nogui /var/tmp/test.praat ; done
phonemes = 陖
phonemes = 鼲
phonemes = 隝
phonemes = 黑
phonemes = 蹑

The patch below fixes the problem for me. I am not sure about the possible colateral effects of bypassing the call to Melder_dup.

--- a/dwtools/SpeechSynthesizer.cpp
+++ b/dwtools/SpeechSynthesizer.cpp
@@ -701,7 +701,7 @@ conststring32 SpeechSynthesizer_getPhonemesFromText (SpeechSynthesizer me, const
 			} else
 				MelderString_append (& phonemes, phonemeLabel, (iint < numberOfIntervals ? phonemeSeparator : U"") );
 		}
-		return Melder_dup (phonemes.string).get();   // TODO: implement MelderString_move()
+		return phonemes.string;
 	} catch (MelderError) {
 		Melder_throw (U"Phonemes not generated.");
 	}

Just for the record, this issue causes the unit test dwtest/test_SpeechSynthesizer.praat to fail in version 6.3.15.