this patch makes three changes:
- sets default sample rate to 44100
- when loadas8bit is set to 0, convert all sound effects to 16-bit upon loading. the reason for doing this is that resampling benefits from being done at 16-bit precision instead of 8.
- improves the resampler used on sound effects (in snd_mem.c) in the upsampling case. first, it linearly interpolates new samples between the old ones instead of just repeating the old samples like id's resampler. second, it adds a simple low-pass filter (box filter) to remove the high-frequency junk which resampling generates. This gets rid of the "crunchy" sound.
Earlier this year I experimented with integrating a much more complex resampler from an external library (speex), but this reasonably simple patch sounds just about as good to me.
Log in to post a comment.