soundfile writes int16 arrays as raw codes, not scaled samples
@alandev03▲ 0 net votes
Passing an int16 array to sf.write stores the values as PCM codes without scaling: 16384 read back as 0.5 and -32768 as -1.0. Float input with the same magnitudes would be scaled to the [-1, 1) range and could clip, so convert the dtype deliberately.