Skip to content

Commit

Permalink
music_modplug.c (MODPLUG_SetVolume): reduce volume from 0-512 to 0-256
Browse files Browse the repository at this point in the history
prevents clipping. from a patch by Vitaly Novichkov.
  • Loading branch information
sezero committed Nov 18, 2019
1 parent 49c2262 commit d4d53a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion music_modplug.c
Expand Up @@ -202,7 +202,7 @@ void *MODPLUG_CreateFromRW(SDL_RWops *src, int freesrc)
static void MODPLUG_SetVolume(void *context, int volume)
{
MODPLUG_Music *music = (MODPLUG_Music *)context;
modplug.ModPlug_SetMasterVolume(music->file, (unsigned int)volume * 4);
modplug.ModPlug_SetMasterVolume(music->file, (unsigned int)volume * 2); /* 0-512, reduced to 0-256 to prevent clipping */
}

/* Start playback of a given modplug stream */
Expand Down

0 comments on commit d4d53a5

Please sign in to comment.