From e10dfe039fb4c83fedd9daa260c6d256e66a7652 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 10 Oct 2023 10:19:24 +0100 Subject: [PATCH] fix sound --- render_kdenlive.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/render_kdenlive.py b/render_kdenlive.py index 58e68a6..5740b32 100644 --- a/render_kdenlive.py +++ b/render_kdenlive.py @@ -19,8 +19,16 @@ class KDEnliveProject: def to_xml(self): track = self._main_tractor.xpath(".//track")[0] duration = max(self._duration.values()) - track.attrib["in"] = self._sequence.attrib["in"] = self._main_tractor.attrib["in"] = "0" - track.attrib["out"] = self._sequence.attrib["out"] = self._main_tractor.attrib["out"] = str(duration - 1) + values = { + "in": "0", + "out": str(duration - 1) + } + for key, value in values.items(): + track.attrib[key] = value + self._sequence.attrib[key] = value + self._main_tractor.attrib[key] = value + self._audio_tractor.attrib[key] = value + self._tree.remove(self._sequence) self._tree.append(self._sequence) self._tree.remove(self._main_bin) @@ -305,6 +313,7 @@ class KDEnliveProject: self._sequence = sequence self._main_bin = main_bin self._main_tractor = t4 + self._audio_tractor = t1 self._v1 = v1 self._v2 = v2 self._a1 = a1 @@ -334,7 +343,7 @@ class KDEnliveProject: ("kdenlive:clip_type", "0"), ("kdenlive:folderid", "-1"), ("kdenlive:id", kdenlive_id), - ("set.test_audio", "1"), + ("set.test_audio", "0"), ("set.test_image", "0"), ("xml", "was here"), ]: