pysox
pysox copied to clipboard
set_output_format can not change the encoding type.
I create a transformer object, read a wav file with it, and try to change the sample rate and the encoding type with the following block of code.
tfm = sox.Transformer()
array_in = tfm.build_array(input_filepath=wav_path)
tfm.set_output_format(rate=SAMPLE_RATE_OUT, encoding='floating-point')
array_out = tfm.build_array(input_array=array_in, sample_rate_in=SAMPLE_RATE_IN)
The problem is that the output array is still in PCM and is not converted to floating-point, as specified.