From 5d3b6d5fd84dee29cb706075c08011c83ed10621 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 3 Sep 2015 22:40:02 -0700 Subject: [PATCH] 3DS, Wii: Tweak audio rates a bit --- src/platform/3ds/main.c | 10 +++++----- src/platform/wii/main.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/platform/3ds/main.c b/src/platform/3ds/main.c index b1ab20a90..823e8951d 100644 --- a/src/platform/3ds/main.c +++ b/src/platform/3ds/main.c @@ -83,16 +83,16 @@ static void _gameLoaded(struct GBAGUIRunner* runner) { } #if RESAMPLE_LIBRARY == RESAMPLE_BLIP_BUF - double ratio = GBAAudioCalculateRatio(1, 59.826, 1); - blip_set_rates(runner->context.gba->audio.left, GBA_ARM7TDMI_FREQUENCY, 44100 * ratio); - blip_set_rates(runner->context.gba->audio.right, GBA_ARM7TDMI_FREQUENCY, 44100 * ratio); + double ratio = GBAAudioCalculateRatio(1, 59.8260982880808, 1); + blip_set_rates(runner->context.gba->audio.left, GBA_ARM7TDMI_FREQUENCY, 32768 * ratio); + blip_set_rates(runner->context.gba->audio.right, GBA_ARM7TDMI_FREQUENCY, 32768 * ratio); #endif if (hasSound) { memset(audioLeft, 0, AUDIO_SAMPLE_BUFFER * sizeof(int16_t)); memset(audioRight, 0, AUDIO_SAMPLE_BUFFER * sizeof(int16_t)); audioPos = 0; - csndPlaySound(0x8, SOUND_REPEAT | SOUND_FORMAT_16BIT, 44100, 1.0, -1.0, audioLeft, audioLeft, AUDIO_SAMPLE_BUFFER * sizeof(int16_t)); - csndPlaySound(0x9, SOUND_REPEAT | SOUND_FORMAT_16BIT, 44100, 1.0, 1.0, audioRight, audioRight, AUDIO_SAMPLE_BUFFER * sizeof(int16_t)); + csndPlaySound(0x8, SOUND_REPEAT | SOUND_FORMAT_16BIT, 32768, 1.0, -1.0, audioLeft, audioLeft, AUDIO_SAMPLE_BUFFER * sizeof(int16_t)); + csndPlaySound(0x9, SOUND_REPEAT | SOUND_FORMAT_16BIT, 32768, 1.0, 1.0, audioRight, audioRight, AUDIO_SAMPLE_BUFFER * sizeof(int16_t)); } } diff --git a/src/platform/wii/main.c b/src/platform/wii/main.c index c9f2a5b0b..8f37b6cf5 100644 --- a/src/platform/wii/main.c +++ b/src/platform/wii/main.c @@ -312,7 +312,7 @@ void _setup(struct GBAGUIRunner* runner) { GBAAudioResizeBuffer(&runner->context.gba->audio, SAMPLES); #if RESAMPLE_LIBRARY == RESAMPLE_BLIP_BUF - double ratio = GBAAudioCalculateRatio(1, 60, 1); + double ratio = GBAAudioCalculateRatio(1, 60 / 1.001, 1); blip_set_rates(runner->context.gba->audio.left, GBA_ARM7TDMI_FREQUENCY, 48000 * ratio); blip_set_rates(runner->context.gba->audio.right, GBA_ARM7TDMI_FREQUENCY, 48000 * ratio); #endif