Mercurial > games > semicongine
comparison tests/test_audio.nim @ 673:9cfd59c93ae8
fix: tests
| author | Sam <sam@basx.dev> |
|---|---|
| date | Tue, 09 May 2023 20:39:49 +0700 |
| parents | 977392dc055f |
| children | 972caf83930d |
comparison
equal
deleted
inserted
replaced
| 672:d7c61e6580ea | 673:9cfd59c93ae8 |
|---|---|
| 60 while mixer[].isPlaying(): | 60 while mixer[].isPlaying(): |
| 61 sleep(1) | 61 sleep(1) |
| 62 | 62 |
| 63 proc test3() = | 63 proc test3() = |
| 64 var song: SoundData | 64 var song: SoundData |
| 65 var f = open("tests/audiotest.PCM.s16le.48000.2") | 65 var f = open("./tests/audiotest.PCM.s16le.48000.2") |
| 66 var readLen = 999 | 66 var readLen = 999 |
| 67 while readLen > 0: | 67 while readLen > 0: |
| 68 var sample: Sample | 68 var sample: Sample |
| 69 readLen = f.readBuffer(addr sample, sizeof(Sample)) | 69 readLen = f.readBuffer(addr sample, sizeof(Sample)) |
| 70 song.add sample | 70 song.add sample |
| 83 startMixerThread() | 83 startMixerThread() |
| 84 test1() | 84 test1() |
| 85 mixer[].stop() | 85 mixer[].stop() |
| 86 test2() | 86 test2() |
| 87 mixer[].stop() | 87 mixer[].stop() |
| 88 while true: | 88 # test3() # only run this manually, not in automated tests |
| 89 test3() | 89 # mixer[].stop() |
| 90 mixer[].stop() |
