From 13a2246c50fff6381974e2f1c4347e624218fa99 Mon Sep 17 00:00:00 2001 From: FIX94 Date: Mon, 5 Mar 2018 20:17:51 +0100 Subject: [PATCH] (GX) allow audio output rate to be changed in the settings between 32khz and 48khz --- audio/drivers/gx_audio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/audio/drivers/gx_audio.c b/audio/drivers/gx_audio.c index 5e840a933f..f28cd06bdc 100644 --- a/audio/drivers/gx_audio.c +++ b/audio/drivers/gx_audio.c @@ -83,12 +83,13 @@ static void *gx_audio_init(const char *device, AIInit(NULL); AIRegisterDMACallback(dma_callback); - if (rate < 33000) + //ranges 0-32000 (default low) and 40000-47999 (in settings going down from 48000) -> set to 32000 hz + if (rate <= 32000 || (rate >= 40000 && rate < 48000)) { AISetDSPSampleRate(AI_SAMPLERATE_32KHZ); *new_rate = 32000; } - else + else //ranges 32001-39999 (in settings going up from 32000) and 48000-max (default high) -> set to 48000 hz { AISetDSPSampleRate(AI_SAMPLERATE_48KHZ); *new_rate = 48000;