Change recording bit rate to 16


What is the most minimal way to change the bit rate of SC record output when using basic:


It’s by default 32 bits which is a problem when importing the file in some other audio applications.
( CDP for instance)

Here you can set it:
Possible sampleFormat values are listed in SoundFile:

And by the way, you can set a format too:
Possible values:

But beware, not all sampleFormat + headerFormat combinations are valid. There’s a reference table at libsndfile:


// let's set 16-bit wav
s.recSampleFormat = "int16"
s.recHeaderFormat = "wav"

// or, both in one line:

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.


OK, thanks both, that’s clear.