changeset 980:1ba0e5dfbf68

fix: windows audio test
author sam <sam@basx.dev>
date Sat, 06 Apr 2024 15:46:41 +0700
parents 6406766a222d
children c81541f55d9c
files tests/test_audio.nim
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_audio.nim	Sat Apr 06 15:27:09 2024 +0700
+++ b/tests/test_audio.nim	Sat Apr 06 15:46:41 2024 +0700
@@ -78,6 +78,11 @@
 
   while mixer[].isPlaying():
     discard mixer[].play("ping", track = "effects", stopOtherSounds = true, level = 0.5)
-    echo "Press q and enter to exit"
-    if stdin.readLine() == "q":
+    # on windows we re-open stdin and this will not work
+    when defined(linux):
+      echo "Press q and enter to exit"
+      if stdin.readLine() == "q":
+        mixer[].stop()
+    elif defined(windows):
+      sleep(5)
       mixer[].stop()