Skip to content

Commit 69e7875

Browse files
committed
Fix clipping for loud OGG samples
Fixes #1380
1 parent 932f0b5 commit 69e7875

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/sfloader/fluid_sffile.c

+6
Original file line numberDiff line numberDiff line change
@@ -2500,6 +2500,12 @@ static int fluid_sffile_read_vorbis(SFData *sf, unsigned int start_byte, unsigne
25002500
goto error_exit;
25012501
}
25022502

2503+
// Avoid clipping for loud samples, see
2504+
// https://github.com/FluidSynth/fluidsynth/issues/1380
2505+
// and
2506+
// https://github.com/libsndfile/libsndfile/issues/194
2507+
sf_command(sndfile, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE);
2508+
25032509
/* Automatically decompresses the Ogg Vorbis data to 16-bit PCM */
25042510
if(sf_readf_short(sndfile, wav_data, sfinfo.frames) < sfinfo.frames)
25052511
{

0 commit comments

Comments
 (0)