add game times

This commit is contained in:
2025-02-11 11:45:19 +01:00
parent 5db3519a87
commit 3b5b7bf15b
5 changed files with 39 additions and 15 deletions

View File

@@ -86,7 +86,7 @@ audio_data audio_wav_load(audio_device const* const dev, char const* const fpath
convert_audio(dev, wav_spec, &audio.buf, &audio.len);
// calculate the amount of seconds that the audio fragment has
audio.sec = (audio.len / (SDL_AUDIO_BITSIZE(dev->fmt) / 8)) / wav_spec.channels / dev->freq;
audio.ms = 1000 * (((audio.len) / (SDL_AUDIO_BITSIZE(dev->fmt) / 8)) / wav_spec.channels / dev->freq);
return audio;
}