~alcinnz/rhapsode

8a540270d1da93e211835b650090294db53f48ba — Adrian Cochrane 4 years ago 67bc3ea
Don't let marks interfer with silence collapsing.
1 files changed, 3 insertions(+), 1 deletions(-)

M src/SSML.hs
M src/SSML.hs => src/SSML.hs +3 -1
@@ 56,10 56,10 @@ buildVoices (VoicePattern age gender variant:voices) children = el "voice" [
buildVoices [] children = children

buildBox self childs = concat [
        el "mark" [("name", marker self)] [],
        breakEl $ pauseBefore self,
        audioEl $ cueBefore self,
        breakEl $ restBefore self,
        el "mark" [("name", marker self)] [],
        childs,
        breakEl $ restAfter self,
        audioEl $ cueAfter self,


@@ 95,6 95,8 @@ floatBreaks el@(Element _ _ childs)
    | break@(NodeElement (Element "break" _ _)):nodes <- reverse $ floatBreaks' childs =
        floatBreaks el{elementNodes = reverse nodes} ++ [break]
    | otherwise = [NodeElement el]
floatBreaks' (NodeElement m@(Element "mark" _ _):NodeElement b@(Element "break" _ _):nodes) =
    NodeElement b : floatBreaks' (NodeElement m:nodes)
floatBreaks' (NodeElement el:nodes) = floatBreaks el ++ floatBreaks' nodes
floatBreaks' (node:nodes) = node : floatBreaks' nodes
floatBreaks' [] = []