Python Forum

Full Version: OverflowError: cannot fit 'int' into an index-sized integer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello
I am running a simple audio read program:

import matplotlib.pyplot as plt
import scipy.io.wavfile
rate, data = scipy.io.wavfile.read('file.wav')

plt.plot(data)
plt.show()

but its giving following error:

Error:
Traceback (most recent call last): File "/home/pi/wav_try.py", line 3, in <module> rate, data = scipy.io.wavfile.read('file.wav') File "/home/pi/.local/lib/python3.5/site-packages/scipy/io/wavfile.py", line 264, in read is_big_endian, mmap) File "/home/pi/.local/lib/python3.5/site-packages/scipy/io/wavfile.py", line 129, in _read_data_chunk data = numpy.frombuffer(fid.read(size), dtype=dtype) OverflowError: cannot fit 'int' into an index-sized integer
Please guide how to solve it?
The documentation of scipy.io.wavfile.read() says
Quote:* This function cannot read wav files with 24 bit data.
Couldn't this be the cause of the error?
(Jan-16-2019, 04:48 PM)Gribouillis Wrote: [ -> ]The documentation of scipy.io.wavfile.read() says
Quote:* This function cannot read wav files with 24 bit data.
Couldn't this be the cause of the error?

Hello,

The above program is executing on Pyhton 3.5 on Windows 7

but when I run the same program on Raspberry Pi it is giving the error

Please guide