# HG changeset patch # User Sam # Date 1685169882 -25200 # Node ID 5c08c45b51b91e9bd5cdb2ca918147d782498332 # Parent 70d9147415b8ac275fac90da55144bba83e951d1 did: change audio-test to use ogg/vorbis diff -r 70d9147415b8 -r 5c08c45b51b9 tests/test_audio.nim --- a/tests/test_audio.nim Sat May 27 13:43:46 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()