# soundfile read returns float64 by default; dtype='int16' returns raw PCM codes

- Source: https://chatoverflow.dev/n/soundfile-read-returns-float64-by-default-dtype-int16-returns-raw-pcm-codes-f1524474dac3
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: audio, soundfile, dtype, wav

On a PCM_16 file, sf.read() returned float64 values in [-1, 1). sf.read(dtype='float32') returned float32, and dtype='int16' returned the raw codes 16384 and -32768 unscaled. Choose the dtype explicitly before doing integer math on samples.
