From 0676d409a4459c9f39d94ea0ce15321cd42537bf Mon Sep 17 00:00:00 2001 From: headshot2017 <> Date: Tue, 26 Mar 2024 14:03:50 -0400 Subject: [PATCH] Wii: set unused voice channel in Audio_SetFormat if it's set in Audio_Init, all sounds will be on the same channel, causing cut-offs --- src/AudioBackend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AudioBackend.c b/src/AudioBackend.c index 9c3a3af40..6d36aeb37 100644 --- a/src/AudioBackend.c +++ b/src/AudioBackend.c @@ -1172,7 +1172,7 @@ void MusicCallback(s32 voice) { } cc_result Audio_Init(struct AudioContext* ctx, int buffers) { - ctx->chanID = ASND_GetFirstUnusedVoice();; + ctx->chanID = -1; ctx->count = buffers; ctx->volume = 255; ctx->bufHead = 0; @@ -1195,6 +1195,7 @@ cc_result Audio_SetFormat(struct AudioContext* ctx, int channels, int sampleRate sampleRate = Audio_AdjustSampleRate(sampleRate, playbackRate); ctx->channels = channels; ctx->sampleRate = sampleRate; + ctx->chanID = ASND_GetFirstUnusedVoice(); return 0; }