And fill the last phlist prepause and newword fields, otherwise they are detected as undefined: ==483407== Conditional jump or move depends on uninitialised value(s) ==483407== at 0x488E6AB: Generate (synthesize.c:1228) ==483407== by 0x488FD94: SpeakNextClause (synthesize.c:1587) ==483407== by 0x4887F56: Synthesize (speech.c:457) ==483407== by 0x488884C: sync_espeak_Synth (speech.c:570) ==483407== by 0x487B270: espeak_Synth (espeak_api.c:90) ==483407== by 0x10ACA0: main (espeak-ng.c:691) ==483407== Uninitialised value was created by a client request ==483407== at 0x4884893: MakePhonemeList (phonemelist.c:155) ==483407== by 0x4895712: TranslateClause (translate.c:2682) ==483407== by 0x488FCCF: SpeakNextClause (synthesize.c:1569) ==483407== by 0x4887F56: Synthesize (speech.c:457) ==483407== by 0x488884C: sync_espeak_Synth (speech.c:570) ==483407== by 0x487B270: espeak_Synth (espeak_api.c:90) ==483407== by 0x10ACA0: main (espeak-ng.c:691) ==483407== ==483407== Conditional jump or move depends on uninitialised value(s) ==483407== at 0x488E622: Generate (synthesize.c:1211) ==483407== by 0x488FD94: SpeakNextClause (synthesize.c:1587) ==483407== by 0x4887F56: Synthesize (speech.c:457) ==483407== by 0x488884C: sync_espeak_Synth (speech.c:570) ==483407== by 0x487B270: espeak_Synth (espeak_api.c:90) ==483407== by 0x10ACA0: main (espeak-ng.c:691) ==483407== Uninitialised value was created by a client request ==483407== at 0x4884893: MakePhonemeList (phonemelist.c:155) ==483407== by 0x4895712: TranslateClause (translate.c:2682) ==483407== by 0x488FCCF: SpeakNextClause (synthesize.c:1569) ==483407== by 0x4887F56: Synthesize (speech.c:457) ==483407== by 0x488884C: sync_espeak_Synth (speech.c:570) ==483407== by 0x487B270: espeak_Synth (espeak_api.c:90) ==483407== by 0x10ACA0: main (espeak-ng.c:691) ==483407== This is changing the ssml.test output, but with no audible difference, so this is probably a real fix for it.master
#include "phoneme.h" | #include "phoneme.h" | ||||
#include "synthesize.h" | #include "synthesize.h" | ||||
#include "translate.h" | #include "translate.h" | ||||
#include "speech.h" | |||||
const unsigned char pause_phonemes[8] = { | const unsigned char pause_phonemes[8] = { | ||||
0, phonPAUSE_VSHORT, phonPAUSE_SHORT, phonPAUSE, phonPAUSE_LONG, phonGLOTTALSTOP, phonPAUSE_LONG, phonPAUSE_LONG | 0, phonPAUSE_VSHORT, phonPAUSE_SHORT, phonPAUSE, phonPAUSE_LONG, phonGLOTTALSTOP, phonPAUSE_LONG, phonPAUSE_LONG | ||||
plist2 = ph_list2; | plist2 = ph_list2; | ||||
phlist = phoneme_list; | phlist = phoneme_list; | ||||
end_sourceix = plist2[n_ph_list2-1].sourceix; | end_sourceix = plist2[n_ph_list2-1].sourceix; | ||||
MAKE_MEM_UNDEFINED(&phoneme_list, sizeof(phoneme_list)); | |||||
// is the last word of the clause unstressed ? | // is the last word of the clause unstressed ? | ||||
max_stress = 0; | max_stress = 0; | ||||
phlist[ix].length = post_pause; // length of the pause, depends on the punctuation | phlist[ix].length = post_pause; // length of the pause, depends on the punctuation | ||||
phlist[ix].sourceix = end_sourceix; | phlist[ix].sourceix = end_sourceix; | ||||
phlist[ix].synthflags = 0; | phlist[ix].synthflags = 0; | ||||
phlist[ix].prepause = 0; | |||||
phlist[ix++].ph = phoneme_tab[phonPAUSE]; | phlist[ix++].ph = phoneme_tab[phonPAUSE]; | ||||
phlist[ix].newword = 0; | |||||
phlist[ix].phcode = phonPAUSE; | phlist[ix].phcode = phonPAUSE; | ||||
phlist[ix].type = phPAUSE; | phlist[ix].type = phPAUSE; | ||||
phlist[ix].length = 0; | phlist[ix].length = 0; | ||||
phlist[ix].sourceix = 0; | phlist[ix].sourceix = 0; | ||||
phlist[ix].synthflags = 0; | phlist[ix].synthflags = 0; | ||||
phlist[ix].prepause = 0; | |||||
phlist[ix++].ph = phoneme_tab[phonPAUSE_SHORT]; | phlist[ix++].ph = phoneme_tab[phonPAUSE_SHORT]; | ||||
n_phoneme_list = ix; | n_phoneme_list = ix; |
for i in `ls tests/ssml/*.ssml` ; do test_ssml $i; done | for i in `ls tests/ssml/*.ssml` ; do test_ssml $i; done | ||||
for i in `ls tests/ssml/*.ssml2` ; do test_ssml $i punct; done | for i in `ls tests/ssml/*.ssml2` ; do test_ssml $i punct; done | ||||
test_ssml_audio "<prosody>" fcb28f00670959980038171ceda3c6bdec61b884 "<speak><prosody rate=\"x-slow\" pitch=\"low\"> Slow and low </prosody><prosody rate=\"x-fast\" pitch=\"x-high\"> Fast and high.</prosody></speak>" | |||||
test_ssml_audio "<prosody>" 88fccb35536158f25f4ae44a03fb005fef95c99b "<speak><prosody rate=\"x-slow\" pitch=\"low\"> Slow and low </prosody><prosody rate=\"x-fast\" pitch=\"x-high\"> Fast and high.</prosody></speak>" | |||||
# #410 is a bug in SSML. Sentence termination causes prosody stack to misfunction. | # #410 is a bug in SSML. Sentence termination causes prosody stack to misfunction. | ||||
# Hash 00879af is the buggy version and should fail: | |||||
test_ssml_audio "<prosody> bug #410" 00879aff11dc28a352736ca397ce9567e6f39029 "<speak><prosody rate=\"x-slow\" pitch=\"low\"> Slow and low. </prosody><prosody rate=\"x-fast\" pitch=\"x-high\"> Fast and high.</prosody></speak>" | |||||
# Hash 8d3bace is the buggy version and should fail: | |||||
test_ssml_audio "<prosody> bug #410" 8d3bace9548ae73c4770a73c88c6f65e848b45cf "<speak><prosody rate=\"x-slow\" pitch=\"low\"> Slow and low. </prosody><prosody rate=\"x-fast\" pitch=\"x-high\"> Fast and high.</prosody></speak>" | |||||
test_ssml_audio "<audio>" 5134c1db757b2d6b8d1f3f2416124462e401b4c6 "<speak>ha: <audio src=\"$PWD/phsource/h/ha.wav\"></audio></speak>" | test_ssml_audio "<audio>" 5134c1db757b2d6b8d1f3f2416124462e401b4c6 "<speak>ha: <audio src=\"$PWD/phsource/h/ha.wav\"></audio></speak>" |