dofuuz / python-soxr

Fast and high quality sample-rate conversion library for Python
Other
78 stars 6 forks source link

ValueError: buffer source array is read-only #3

Closed tensorfoo closed 3 years ago

tensorfoo commented 3 years ago

Stack trace below:


  return soxr.resample(np.frombuffer(out, np.float32),44100,16000)
  File "/home/tensorfoo/research/venv/lib/python3.8/site-packages/soxr/__init__.py", line 152, in resample
    return cysoxr_divide_proc_1d(in_rate, out_rate, x, q)
  File "soxr/cysoxr.pyx", line 129, in soxr.cysoxr.__pyx_fuse_0cysoxr_divide_proc_1d
  File "stringsource", line 658, in View.MemoryView.memoryview_cwrapper
  File "stringsource", line 349, in View.MemoryView.memoryview.__cinit__
ValueError: buffer source array is read-only

any ideas?

tensorfoo commented 3 years ago

Thank you! could you please update the pip package also :)

dofuuz commented 3 years ago

Some note on commit 24d7884: Because of Cython bug cython/cython#3820, const fused type MemoryView crashes compiler. Fix cython/cython#3853 has not been backported to 0.29.x. So I used Cython 3.x alpha version anyway.

dofuuz commented 3 years ago

Can you confirm fix with v0.2.5a1?

pip install soxr==0.2.5a1
tensorfoo commented 3 years ago

Can you confirm fix with v0.2.5a1?

pip install soxr==0.2.5a1

Confirmed it works. Thank you.