Mercurial > games > semicongine
diff tests/test_audio.nim @ 980:1ba0e5dfbf68
fix: windows audio test
author | sam <sam@basx.dev> |
---|---|
date | Sat, 06 Apr 2024 15:46:41 +0700 |
parents | 545b4c58601f |
children | 74957cbf589b |
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()