You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
ResampleSfx() and ResampleSfxRaw() in snd_mem.c resample the input audio file to the audio driver's sampling rate. The multiplication by 256=2^8 and subsequent bitshift by 8 bits to the right of the buffer offset allow for an upscaling of input frequencies as low as 1/256 of the target sampling rate, but they reduce the resulting maximum number of samples by 8 bits. This allows only for 95 seconds of playtime at 44.1 khz or 190 seconds at 22 khz. After that, samplefrac overflows.
One "fix" would be to change 2^8 and 8 to smaller values, maybe 2^3=8 and 3, and add a warning message if the sampling rate is too small.
The text was updated successfully, but these errors were encountered:
fmwviormv
added a commit
to fmwviormv/ioq3
that referenced
this issue
Oct 6, 2016
ResampleSfx() and ResampleSfxRaw() in snd_mem.c resample the input audio file to the audio driver's sampling rate. The multiplication by 256=2^8 and subsequent bitshift by 8 bits to the right of the buffer offset allow for an upscaling of input frequencies as low as 1/256 of the target sampling rate, but they reduce the resulting maximum number of samples by 8 bits. This allows only for 95 seconds of playtime at 44.1 khz or 190 seconds at 22 khz. After that, samplefrac overflows.
One "fix" would be to change 2^8 and 8 to smaller values, maybe 2^3=8 and 3, and add a warning message if the sampling rate is too small.
The text was updated successfully, but these errors were encountered: