Scipy wav file format not understood error
See original GitHub issue<<Please describe the issue in detail here, and for bug reports fill in the fields below.>>
I had 2 wav files , that I had been using since the past , and they work perfectly with scipy wave read function , but when I added a new file , it threw following error
Traceback (most recent call last):
File "multidata.py", line 83, in <module>
fs[i], audio[i] = wav.read(audio_filename[i])
File "/home/saurabh/anaconda3/envs/py27/lib/python2.7/site-packages/scipy/io/wavfile.py", line 236, in read
file_size, is_big_endian = _read_riff_chunk(fid)
File "/home/saurabh/anaconda3/envs/py27/lib/python2.7/site-packages/scipy/io/wavfile.py", line 168, in _read_riff_chunk
"understood.".format(repr(str1)))
ValueError: File format '<htm'... not understood.
I have tried recording with sox , arecord and audacity , also made sure there is no metadata , I have also tried all possible settings like mono , 16 bit , 16000 hertz etc , It doesn’t work , even the settings matching with two wav files which the function is able to read
Reproducing code example:
<<A short code example that reproduces the problem. It should be self-contained, i.e., possible to run as-is via 'python myproblem.py'>>
for i,j in enumerate(wav_files): print (i,j) audio_filename[i] = maybe_download(j + ‘.wav’) print ( audio_filename[i]) #print (audio_filename) target_filename[i] = maybe_download(j + ‘.txt’) fs[i], audio[i] = wav.read(audio_filename[i]) #print (audio[i])
maybe_download is a function that checks if file exists locally , otherwise downloads it
Error message:
<<Full error message, if any (starting from line Traceback: ...)>>
Scipy/Numpy/Python version information:
<<Output from 'import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)'>>
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (3 by maintainers)
Top Related StackOverflow Question
From the error message
ValueError: File format '<htm'... not understood., I strongly suspect your file is not a WAV file, and is likely an HTML file. Have you looked at the contents of the file? Try viewing it in an editor.@Aliktk Seems like a question to ask on Stack Overflow, not here