Fix 16-bit audio mixing

This commit is contained in:
nukeykt 2019-07-24 23:25:30 +09:00 committed by Christoph Oelckers
parent 2762044313
commit 6c08ae1966
2 changed files with 6 additions and 6 deletions

View file

@ -98,7 +98,7 @@ uint32_t MV_Mix16BitMono16(struct VoiceNode * const voice, uint32_t length)
do
{
int32_t const isample0 = B_LITTLE16(source[position >> 16]);
int32_t const isample0 = (int16_t)B_LITTLE16(source[position >> 16]);
position += rate;
@ -128,7 +128,7 @@ uint32_t MV_Mix16BitStereo16(struct VoiceNode * const voice, uint32_t length)
do
{
int32_t const isample0 = B_LITTLE16(source[position >> 16]);
int32_t const isample0 = (int16_t)B_LITTLE16(source[position >> 16]);
position += rate;

View file

@ -100,8 +100,8 @@ uint32_t MV_Mix16BitMono16Stereo(struct VoiceNode * const voice, uint32_t length
do
{
int32_t const isample0 = B_LITTLE16(source[(position >> 16) << 1]);
int32_t const isample1 = B_LITTLE16(source[((position >> 16) << 1) + 1]);
int32_t const isample0 = (int16_t)B_LITTLE16(source[(position >> 16) << 1]);
int32_t const isample1 = (int16_t)B_LITTLE16(source[((position >> 16) << 1) + 1]);
position += rate;
@ -131,8 +131,8 @@ uint32_t MV_Mix16BitStereo16Stereo(struct VoiceNode * const voice, uint32_t leng
do
{
int32_t const isample0 = B_LITTLE16(source[(position >> 16) << 1]);
int32_t const isample1 = B_LITTLE16(source[((position >> 16) << 1) + 1]);
int32_t const isample0 = (int16_t)B_LITTLE16(source[(position >> 16) << 1]);
int32_t const isample1 = (int16_t)B_LITTLE16(source[((position >> 16) << 1) + 1]);
position += rate;