Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
cf79eb93 by mesonium at 2023-01-13T08:46:55+00:00
fix: Audio Preview: Sync clock to make short files play properly on Win

- - - - -


1 changed file:

- gajim/gtk/preview_audio.py


Changes:

=====================================
gajim/gtk/preview_audio.py
=====================================
@@ -17,6 +17,7 @@
 from typing import Any
 
 import logging
+import sys
 from pathlib import Path
 
 from gi.repository import Gdk
@@ -207,7 +208,15 @@ def _setup_audio_player(self, file_path: Path) -> None:
             assert audioconvert is not None
             assert scaletempo is not None
             assert audioresample is not None
-            autoaudiosink.set_property('sync', False)
+
+            # On Windows the first fraction of an audio
+            # would not play if not synced.
+            # On Linux there can be a delay before playback starts with sync,
+            # which is however not the case on Windows.
+            if sys.platform == 'win32':
+                autoaudiosink.set_property('sync', True)
+            else:
+                autoaudiosink.set_property('sync', False)
 
             audio_sink.add(audioconvert)
             audio_sink.add(scaletempo)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/cf79eb939a981e09b494797c6a0cc5eed257018e

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/cf79eb939a981e09b494797c6a0cc5eed257018e
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to