properer int16_t to float scaling in .xm sampling

This commit is contained in:
veclav talica 2024-08-20 17:07:34 +03:00
parent 14a9915ce9
commit 24195ab560

View File

@ -303,7 +303,7 @@ static void audio_sample_and_mixin_channel(const struct audio_channel *channel,
/* convert floats to int16_t */ /* convert floats to int16_t */
for (int p = 0; p < samples_per_channel * 2; ++p) for (int p = 0; p < samples_per_channel * 2; ++p)
((int16_t *)buffer)[p] = (int16_t)(((float *)buffer)[p] * 32768.0f); ((int16_t *)buffer)[p] = (int16_t)(((float *)buffer)[p] * (float)INT16_MAX);
/* panning and mixing */ /* panning and mixing */
audio_mixin_streams(channel, audio_mixin_streams(channel,