[SciPy-User] scipy.io.wavfile.read

Nils Wagner nwagner@iam.uni-stuttgart...
Tue Mar 2 13:31:04 CST 2010


Hi all,

I tried to read a *.wav file using

scipy.io.wavfile.read

from scipy.io import wavfile
from pylab import plot, show
samplerate, data = wavfile.read('BagPipes.wav')

It failed with

  /home/nwagner/local/lib64/python2.6/site-packages/pytz/__init__.py:29: 
UserWarning: Module pkg_resources was already imported 
from 
/home/nwagner/local/lib64/python2.6/site-packages/setuptools-0.6c9-py2.6.egg/pkg_resources.py, 
but 
/home/nwagner/local/lib64/python2.6/site-packages/distribute-0.6.4-py2.6.egg 
is being added to sys.path
   from pkg_resources import resource_stream
/home/nwagner/local/lib64/python2.6/site-packages/pytz/__init__.py:29: 
UserWarning: Module site was already imported from 
/usr/lib64/python2.6/site.pyc, but 
/home/nwagner/local/lib64/python2.6/site-packages/distribute-0.6.4-py2.6.egg 
is being added to sys.path
   from pkg_resources import resource_stream
/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/wavfile.py:20: 
WavFileWarning: Unfamiliar format bytes
   warnings.warn("Unfamiliar format bytes", 
WavFileWarning)
/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/wavfile.py:92: 
WavFileWarning: chunk not understood
   warnings.warn("chunk not understood", WavFileWarning)
Traceback (most recent call last):
   File "read_wav.py", line 9, in <module>
     samplerate, data = wavfile.read('BagPipes.wav')
   File 
"/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/wavfile.py", 
line 90, in read
     data = _read_data_chunk(fid, noc, bits)
   File 
"/home/nwagner/local/lib64/python2.6/site-packages/scipy/io/wavfile.py", 
line 43, in _read_data_chunk
     data = numpy.fromfile(fid, dtype=dtype, 
count=size//bytes)
ZeroDivisionError: integer division or modulo by zero

Any idea ?


The example file is available at 
http://www.ilovewavs.com/Effects/Music/Music.htm

Cheers,

                    Nils


More information about the SciPy-User mailing list