pysox icon indicating copy to clipboard operation
pysox copied to clipboard

set_output_format can not change the encoding type.

Open raraz15 opened this issue 3 years ago • 0 comments

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.

raraz15 avatar Aug 26 '21 09:08 raraz15