Mercurial > games > semicongine
changeset 264:dc2304a1bc0a
did: change audio-test to use ogg/vorbis
author | Sam <sam@basx.dev> |
---|---|
date | Sat, 27 May 2023 13:44:42 +0700 |
parents | d1ee2a815fa1 |
children | ad4f2b45410b |
files | tests/test_audio.nim |
diffstat | 1 files changed, 4 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test_audio.nim Sat May 27 13:44:02 2023 +0700 +++ b/tests/test_audio.nim Sat May 27 13:44:42 2023 +0700 @@ -61,23 +61,14 @@ sleep(1) proc test3() = - var song: SoundData - var f = open("./tests/audiotest.PCM.s16le.48000.2") - var readLen = 999 - while readLen > 0: - var sample: Sample - readLen = f.readBuffer(addr sample, sizeof(Sample)) - song.add sample - - mixer[].addSound("pianosong", newSound(song)) + mixer[].addSound("pianosong", loadAudio("test.ogg")) mixer[].addSound("ping", newSound(sineSoundData(500, 0.05, 44100))) mixer[].addTrack("effects") discard mixer[].play("pianosong") - let t0 = now() while mixer[].isPlaying(): discard mixer[].play("ping", track="effects", stopOtherSounds=true, level=0.5) - var input = stdin.readLine() + discard stdin.readLine() when isMainModule: startMixerThread() @@ -85,3 +76,5 @@ mixer[].stop() test2() mixer[].stop() + test3() + mixer[].stop()