comparison 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
comparison
equal deleted inserted replaced
979:6406766a222d 980:1ba0e5dfbf68
76 mixer[].stop() 76 mixer[].stop()
77 test3() 77 test3()
78 78
79 while mixer[].isPlaying(): 79 while mixer[].isPlaying():
80 discard mixer[].play("ping", track = "effects", stopOtherSounds = true, level = 0.5) 80 discard mixer[].play("ping", track = "effects", stopOtherSounds = true, level = 0.5)
81 echo "Press q and enter to exit" 81 # on windows we re-open stdin and this will not work
82 if stdin.readLine() == "q": 82 when defined(linux):
83 echo "Press q and enter to exit"
84 if stdin.readLine() == "q":
85 mixer[].stop()
86 elif defined(windows):
87 sleep(5)
83 mixer[].stop() 88 mixer[].stop()