melizalab / chirp

Pitch-based analysis and comparison of bioacoustic signals
http://melizalab.github.io/chirp/
GNU General Public License v2.0
12 stars 5 forks source link

chirp gui fails silently if file format is not liked #3

Closed danstowell closed 11 years ago

danstowell commented 11 years ago

This one is not a major worry for me, but I expect it would trip some people up:

The first soundfile I opened was a 24-bit WAV file. The GUI didn't show anything. I didn't know if it had loaded or not. Then I realised that the commandline was showing a problem:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/chirp-1.2.1-py2.7-linux-x86_64.egg/chirp/gui/chirpgui.py", line 505, in on_open
    self.load_file(infile)
  File "/usr/local/lib/python2.7/dist-packages/chirp-1.2.1-py2.7-linux-x86_64.egg/chirp/gui/chirpgui.py", line 381, in load_file
    fp = ewave.wavfile(fname)
  File "/usr/local/lib/python2.7/dist-packages/ewave.py", line 71, in __init__
    self._load_header()
  File "/usr/local/lib/python2.7/dist-packages/ewave.py", line 258, in _load_header
    raise Error, "invalid bits per sample: %d" % bits
ewave.Error: invalid bits per sample: 24

24 bits-per-sample is not truly "invalid" but if ewave can't cope with it, that's a limitation one might have to live with. But it would be nice if the GUI would catch the exception and show the user that there was an error in loading.

dmeliza commented 11 years ago

Thanks, that's a good error to catch.

And you're right, 24-bit wave file are valid, but ewave can't handle them at present because they can't be easily mapped into memory. Now that I know folks have data in that formatI'll add that as an issue on the ewave repository and try to fix it at some point.