buffer_read doesn't work in basic test
mcclure opened this issue · comments
mcclure commented
I build and install tag 0.12.1 of libsoundfile in a venv. Then I run this script:
import soundfile
s = soundfile.SoundFile("clap.wav")
b = s.buffer_read('int16')
print(b)
I get the error:
Traceback (most recent call last):
File "C:\Users\Andi\work\g\other\python-soundfile\BUFFERTEST.py", line 3, in <module>
s.buffer_read('int16')
File "C:\Users\Andi\work\g\other\python-soundfile\soundfile.py", line 931, in buffer_read
frames = self._check_frames(frames, fill_value=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Andi\work\g\other\python-soundfile\soundfile.py", line 1298, in _check_frames
if frames < 0 or (frames > remaining_frames and
^^^^^^^^^^
TypeError: '<' not supported between instances of 'str' and 'int'
numpy was not installed for this test, I was trying to test the configuration from #406.
EDIT: Trying again with numpy, I get the same failure.
Bastian Bechtold commented
buffer_read
requires an integer as its first argument.
mcclure commented
Oh. Oh no. I see what I did D: