diff options
Diffstat (limited to 'platform.c')
-rw-r--r-- | platform.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1,6 +1,7 @@ #include "config.h" -#include "render.h" #include "input.h" +#include "render.h" +#include "sound.h" #if defined(plat_emscripten) #include <emscripten.h> @@ -145,17 +146,17 @@ int audio_len, audio_pos; int ticker; void fill_audio(void *udata, Uint8 *stream, int len) { - /*if (audio_len == 0) { + if (audio_len == 0) { audio_len = 1024; audio_pos = 0; } len = (len > audio_len ? audio_len : len); - sound_sys.mix(((unsigned short*)stream), len); + sound_mix(((unsigned char*)stream), len); audio_pos += len; - audio_len -= len;*/ + audio_len -= len; } void reset_input() { @@ -363,8 +364,8 @@ int main(int argc, char** argv) { SDL_SetWindowTitle(window, game_name); #if !no_sound - aud_spec.freq = 22050; - aud_spec.format = AUDIO_U16; + aud_spec.freq = 8000; + aud_spec.format = AUDIO_U8; aud_spec.channels = 1; aud_spec.samples = 1024; aud_spec.callback = fill_audio; |