tuffy / python-audio-tools

A collection of audio handling programs which work from the command line.
http://audiotools.sourceforge.net
GNU General Public License v2.0
249 stars 58 forks source link

IOError: I/O error parsing values for file created with avconv (ffmpeg) #28

Open shaolo1 opened 10 years ago

shaolo1 commented 10 years ago

The mp3 created from the following command has a header that audiotools will not accept.

avconv -i out.wav -ab 320k -acodec libmp3lame out.mp3

Traceback (most recent call last): File "test.py", line 18, in audiofile = audiotools.open('out.mp3') File "/usr/local/lib/python2.7/dist-packages/audiotools/init.py", line 1443, in open return audio_class(filename) File "/usr/local/lib/python2.7/dist-packages/audiotools/mp3.py", line 166, in init 0).parse("32p 32p 32u 32p 832p")[0] * IOError: I/O error parsing values

tuffy commented 10 years ago

I've added an additional check which should keep that error from occurring. But a short Xing header in the first frame of an MP3 file might indicate the file hadn't been fully written to disk for some reason.