# HG changeset patch # User Sam # Date 1685169882 -25200 # Node ID dc2304a1bc0a3fd95fc97f603282cb4c24dd272b # Parent d1ee2a815fa1572713c19ad5c64d4ca1ea3825a3 did: change audio-test to use ogg/vorbis diff -r d1ee2a815fa1 -r dc2304a1bc0a tests/test_audio.nim --- 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()