diff --git a/townengine/audio.c b/townengine/audio.c index f999c6c..a66a4d1 100644 --- a/townengine/audio.c +++ b/townengine/audio.c @@ -303,7 +303,7 @@ static void audio_sample_and_mixin_channel(const struct audio_channel *channel, /* convert floats to int16_t */ 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 */ audio_mixin_streams(channel,