From 6aa4840777f9b7e8f343c6250cc6203572d0ff4a Mon Sep 17 00:00:00 2001 From: Quinn Date: Tue, 25 Mar 2025 11:33:40 +0100 Subject: [PATCH] improve comments for audio milliseconds computation --- src/window/audio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window/audio.c b/src/window/audio.c index fc4c93c..c39d448 100644 --- a/src/window/audio.c +++ b/src/window/audio.c @@ -185,8 +185,9 @@ audiodata audio_wav_load(audiodevice const* dev, char const* fpath) { return (audiodata){0}; } - // calculate the time in miliseconds of the audio fragment audio.ms = 1000 * (((audio.len) / (SDL_AUDIO_BITSIZE(dev->fmt) / 8)) / spec.channels / dev->freq); + // 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 return audio; }