# HG changeset patch # User Sam # Date 1687624946 -25200 # Node ID 7324f258c5b6c74669b99c8fb97dec49c4a0de02 # Parent 8817b99ae16e546a6e559f6ac61e93a1f4ae3475 fix: one-fix for broken mono-sounds $( diff -r 8817b99ae16e -r 7324f258c5b6 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: