From 646629adc167ff3cc30df1a6782736827e0297a9 Mon Sep 17 00:00:00 2001 From: Quinn Date: Tue, 25 Mar 2025 11:45:40 +0100 Subject: [PATCH] fix: use the audio device's channels, rather than the source's channels yes, I know this is dumb, I knew something was wrong when I had to do it that way, but I was dumb. Now... I'm still dumb, just slightly more knowledgable. --- src/window/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window/audio.c b/src/window/audio.c index 2c6eaae..b3f0265 100644 --- a/src/window/audio.c +++ b/src/window/audio.c @@ -187,7 +187,7 @@ audiodata audio_wav_load(audiodevice const* dev, char const* fpath) { // calculate the time in milliseconds of the audio fragment // by dividing the audio bytelength by the format's bitsize, by the audio device's channels and the audio device's frequency - audio.ms = (((1000 * audio.len) / (SDL_AUDIO_BITSIZE(dev->fmt) / 8)) / spec.channels / dev->freq); + audio.ms = (((1000 * audio.len) / (SDL_AUDIO_BITSIZE(dev->fmt) / 8)) / dev->channels / dev->freq); return audio; }