From 10fcb8a09a5dc2b4f5301a0c6f733f502260ae22 Mon Sep 17 00:00:00 2001 From: Quinn Date: Tue, 25 Mar 2025 11:55:56 +0100 Subject: [PATCH] fix: use dev's channels for the time computation, rather than the local channel count --- 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 6553725..df84543 100644 --- a/src/window/audio.c +++ b/src/window/audio.c @@ -186,7 +186,7 @@ audiodata audio_wav_load(audiodevice const* dev, char const* fpath) { } // calculate the time in miliseconds of the audio fragment - audio.ms = ((((audio.len / (SDL_AUDIO_BITSIZE(dev->fmt) / 8)) / spec.channels) * 1000) / dev->freq); + audio.ms = ((((audio.len / (SDL_AUDIO_BITSIZE(dev->fmt) / 8)) / dev->channels) * 1000) / dev->freq); return audio; }