# HG changeset patch # User Sam # Date 1687624946 -25200 # Node ID 93cedb9635c1b51b84737d80da7d6e53104f15f1 # Parent f25e9e19b5fa7748612e08ab27e7b7bdb9b3ac01 fix: one-fix for broken mono-sounds $( diff -r f25e9e19b5fa -r 93cedb9635c1 src/semicongine/resources/audio.nim --- a/src/semicongine/resources/audio.nim Sat Jun 24 21:04:13 2023 +0700 +++ b/src/semicongine/resources/audio.nim Sat Jun 24 23:42:26 2023 +0700 @@ -34,8 +34,6 @@ else: result[1] = result[0] - - # https://en.wikipedia.org/wiki/Au_file_format proc readAU*(stream: Stream): Sound = var header: AuHeader @@ -81,8 +79,8 @@ raise newException(Exception, &"Only support sample rate of {AUDIO_SAMPLE_RATE} Hz but got {sampleRate} Hz, please resample (e.g. ffmpeg -i -acodec libvorbis -ar {AUDIO_SAMPLE_RATE} )") result = new Sound - result[].setLen(int(nSamples)) if channels == 2: + result[].setLen(int(nSamples)) copyMem(addr result[][0], output, nSamples * sizeof(Sample)) free(output) elif channels == 1: