You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug where SSML tags are ignored if they occur at the end of a sentence, e.g. for marks and breaks.
E.g. for <s>No mark<mark name="before-time"/></s>, the tag marks_after is expected after the word mark, but is left out.
Another point is that neither the marks_before nor pause_before_ms are ever used, just the after variants.
Example:
from gruut import sentences
ssml_text = """<?xml version="1.0"?>
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/10/synthesis
http://www.w3.org/TR/speech-synthesis/synthesis.xsd"
xml:lang="en-US">
<s>No mark<mark name="before-time"/></s>
<s>Yes<mark name="before-time"/> mark</s>
<s>No break <break time="1s"/></s>
<s>With <break time="1s"/> break</s>
</speak>"""
for sent in sentences(ssml_text, ssml=True):
for word in sent:
if word.phonemes:
x = {
"sent_idx": word.sent_idx,
"lang": word.lang,
"orig": word.text,
"phones": list(word.phonemes),
"is_punct": word.is_punctuation,
}
extras = [
"marks_before",
"marks_after",
"pause_before_ms",
"pause_after_ms",
]
for extra in extras:
attr_value = word.__getattribute__(extra)
if attr_value:
x[extra] = attr_value
print(x)
There is a bug where SSML tags are ignored if they occur at the end of a sentence, e.g. for marks and breaks.
E.g. for
<s>No mark<mark name="before-time"/></s>
, the tagmarks_after
is expected after the word mark, but is left out.Another point is that neither the
marks_before
norpause_before_ms
are ever used, just theafter
variants.Example:
Outputs:
The text was updated successfully, but these errors were encountered: