Mercurial > games > semicongine
diff tests/test_audio.nim @ 1332:df3c075e5dea
did: formatting
author | sam <sam@basx.dev> |
---|---|
date | Thu, 22 Aug 2024 18:31:59 +0700 |
parents | e0326aa067c8 |
children |
line wrap: on
line diff
--- a/tests/test_audio.nim Thu Aug 22 18:31:03 2024 +0700 +++ b/tests/test_audio.nim Thu Aug 22 18:31:59 2024 +0700 @@ -4,12 +4,10 @@ import ../semicongine - proc test1() = mixer[].addSound("test1", sineSoundData(1000, 2, 44100)) mixer[].addSound("test2", sineSoundData(500, 2, 44100)) - let s1 = mixer[].play("test1", loop = true) let s2 = mixer[].play("test2", loop = true) @@ -45,14 +43,8 @@ # song frerejaquesData = concat( - f, g, a, f, - f, g, a, f, - a, bb, c2, c2, - a, bb, c2, c2, - c2Short, d2Short, c2Short, bbShort, a, f, - c2Short, d2Short, c2Short, bbShort, a, f, - f, c, f, f, - f, c, f, f, + f, g, a, f, f, g, a, f, a, bb, c2, c2, a, bb, c2, c2, c2Short, d2Short, c2Short, + bbShort, a, f, c2Short, d2Short, c2Short, bbShort, a, f, f, c, f, f, f, c, f, f, ) mixer[].addSound("frerejaques", frerejaquesData) @@ -67,7 +59,6 @@ mixer[].addTrack("effects") discard mixer[].play("toccata et fugue") - when isMainModule: test1() mixer[].stop() @@ -78,9 +69,10 @@ while mixer[].isPlaying(): # on windows we re-open stdin and this will not work when defined(linux): - discard mixer[].play("ping", track = "effects", stopOtherSounds = true, level = 0.5) + discard + mixer[].play("ping", track = "effects", stopOtherSounds = true, level = 0.5) echo "Press q and enter to exit" if stdin.readLine() == "q": mixer[].stop() elif defined(windows): - sleep(1000) \ No newline at end of file + sleep(1000)