Open SamuelLarkin opened 2 years ago
just remove '[0]' in /opt/python/sox/transform.py", line 793
Can confirm in v1.4.1:
Python 3.10.11 (main, Apr 4 2023, 22:10:32) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sox
>>> tfm=sox.Transformer()
>>> tfm.set_input_format(file_type='raw', rate=16000, bits=16,
... channels=1, encoding='signed-integer')
>>> tfm.silence(min_silence_duration=0.25,
... buffer_around_silence=True)
<sox.transform.Transformer object at 0x7fdb8e043460>
>>> pcm = tfm.build_array('static/audio-22212508.raw')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/runner/webrec/.pythonlibs/lib/python3.10/site-packages/sox/transform.py", line 793, in build_array
encoding_out = [
IndexError: list index out of range
>>>
just remove '[0]' in /opt/python/sox/transform.py", line 793
If you mean at https://github.com/rabitt/pysox/blob/master/sox/transform.py#L825 that doesn't work, sorry:
>>> pcm = tfm.build_array('static/audio-22212508.raw')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/runner/webrec/.pythonlibs/lib/python3.10/site-packages/sox/transform.py", line 829, in build_array
raise ValueError("invalid n_bits {}".format(n_bits))
ValueError: invalid n_bits 0
>>>
Hi, I'm attempting to translate
to a call to
build_array()
but I can't seem to be able to specify the equivalent of-t raw
.Code
Error Message