From 7402ac40fb3b415c45f795a816c289d8250319a1 Mon Sep 17 00:00:00 2001 From: ElijahZAwesome Date: Fri, 9 Feb 2018 16:18:49 -0600 Subject: [PATCH] improved sound encoding, thanks nop90 --- build.bat | 1 - source/Sound.c | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/build.bat b/build.bat index bad75bd..02cc9e8 100755 --- a/build.bat +++ b/build.bat @@ -1,6 +1,5 @@ @echo off echo Building 3DSX/ELF/SMDH... -set mypath=%cd% make echo Creating banner... bannertool.exe makebanner -i icons-banners/banner.png -a icons-banners/audio.wav -o icons-banners/banner.bnr diff --git a/source/Sound.c b/source/Sound.c index b5189d0..0e43681 100755 --- a/source/Sound.c +++ b/source/Sound.c @@ -8,10 +8,10 @@ void loadSound(Sound * snd, char * filename){ FILE *file = fopen(filename, "rb"); if(file != NULL){ fseek(file, 0, SEEK_END); - snd->size = ftell(file); - fseek(file, 0, SEEK_SET); - snd->buffer = linearAlloc(snd->size); - fread(snd->buffer, 1, snd->size, file); + snd->size = ftell(file)/2; + fseek(file, 0, SEEK_SET); + snd->buffer = linearAlloc(snd->size*sizeof(u16)); + fread(snd->buffer, 1, snd->size, file); } fclose(file); }