Python Forum
OverflowError: cannot fit 'int' into an index-sized integer
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OverflowError: cannot fit 'int' into an index-sized integer
#1
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?
Reply
#2
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?
Reply
#3
(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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  random.sample raises OverflowError sky3141 4 3,061 Jan-29-2020, 10:53 AM
Last Post: sky3141
  [Help] A function that generates an n x n sized board? vanicci 5 4,778 Aug-14-2018, 02:26 PM
Last Post: vanicci
  Separating a string into evenly sized elements in a list kennybassett 9 6,387 Jun-14-2017, 08:22 AM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020