fix: use dev's channels for the time computation, rather than the local channel count

This commit is contained in:
2025-03-25 11:55:56 +01:00
parent 0f839d0803
commit 10fcb8a09a

View File

@@ -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;
}