Skip to content
Snippets Groups Projects
Commit c977d174 authored by ilag11111's avatar ilag11111
Browse files

Prevent truncation when resampling sounds with non-multiples of 11250.

parent e62c0794
No related branches found
No related tags found
No related merge requests found
......@@ -220,7 +220,7 @@ static Mix_Chunk *ds2chunk(void *stream)
break;
default: // convert arbitrary hz to 44100.
step = 0;
frac = ((UINT32)freq << FRACBITS) / 44100;
frac = ((UINT32)freq << FRACBITS) / 44100 + 1; //Add 1 to counter truncation.
while (i < samples)
{
o = (INT16)(*s+0x80)<<8; // changed signedness and shift up to 16 bits
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment