Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong output for "Create SpeechSynthesizer" in Praat 6.3.15 #2463

Open
rlaboiss opened this issue Aug 26, 2023 · 2 comments
Open

Wrong output for "Create SpeechSynthesizer" in Praat 6.3.15 #2463

rlaboiss opened this issue Aug 26, 2023 · 2 comments

Comments

@rlaboiss
Copy link
Member

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 = 蹑
@rlaboiss
Copy link
Member Author

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.");
 	}

@rlaboiss
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant