But beware, not all sampleFormat + headerFormat combinations are valid. There’s a reference table at libsndfile: http://www.mega-nerd.com/libsndfile/
Example:
// let's set 16-bit wav
s.recSampleFormat = "int16"
s.recHeaderFormat = "wav"
// or, both in one line:
s.recSampleFormat_("int16").recHeaderFormat_("wav")
FWIW I would recommend recording to 32 bits, so that you can recover from out-of-range signals.
If you have 32-bit floats, the shape of out-of-range signals is preserved, and the ffmpeg utility can convert them (and you can script this in SC, to do multiple files).
If you have 16-bit integers and some parts of the signal went out of range, the shape is lost forever and you can never get it back. So it’s mild inconvenience on the one hand, vs risk of permanent loss of some of the data on the other.