#17 gwc cannot open WAV file

closed
nobody
None
1
2006-10-01
2006-08-01
Péter Szabó
No

When I try to open a WAV file in gwc-0.21-05, I get the
``Attempted to read past end of audio, first=0,
last=0'' warning window a few dozen times, then gwc
crashes with a segfault.

`file in.wav' says:

in.wav: RIFF (little-endian) data, WAVE audio,
Microsoft PCM, 16 bit, stereo 44100 Hz

mplayer can play the WAV file, and lame can encode it
to MP3. So I think it is a good WAV file. But gwc
cannot open it.

Discussion

  • Jeff Welty
    Jeff Welty
    2006-10-01

    Logged In: YES
    user_id=269392

    The audio header of your WAV file is probably corrupt, and
    doesn't reflect the actual number of samples in the file.
    Other applications such as mplayer and lame don't depend on
    this information, but GWC does need it to be correct. The
    next release will trap this condition better and report the
    header corruption.

    Cheers,
    Jeff

     
  • Jeff Welty
    Jeff Welty
    2006-10-01

    • priority: 5 --> 1
    • status: open --> closed
     
  • Péter Szabó
    Péter Szabó
    2006-10-02

    Logged In: YES
    user_id=1492986

    > The audio header of your WAV file is probably corrupt, and
    > doesn't reflect the actual number of samples in the file.

    That's true.

    > Other applications such as mplayer and lame don't depend on
    > this information, but GWC does need it to be correct. The
    > next release will trap this condition better and report the
    > header corruption.

    What about autodetecting the file size and use that
    information to override the WAV header when opening the file?

     
  • Jeff Welty
    Jeff Welty
    2006-10-02

    Logged In: YES
    user_id=269392

    What about autodetecting the file size and use that
    information to override the WAV header when opening the file?

    Unfortunately it's not that simple -- libsndfile is the
    interface between GWC and the audio file. WAV is one of
    about a dozen formats that libsndfile can read/write.

    But here is a little perl script I found that claims it can
    fix a corrupt header in a wavfile. Give it a try (back up
    your wavfile first!).

     
  • Jeff Welty
    Jeff Welty
    2006-10-02

    wavfix.pl

     
    Attachments
  • Péter Szabó
    Péter Szabó
    2006-10-08

    Logged In: YES
    user_id=1492986

    I've upgraded to gwc_0.21-05, libsndfile_1.0.17,
    libaudiofile-0.2.6-r1, and now GWC seems to be able to open
    truncated WAV files properly. So the problem seems to have
    disappeared/been solved.

    I have also contacted the libsndfile developers, and Erik de
    Castro Lopo replied. He said that they are designing
    libsndfile so that it is able to open broken files. At
    least, version 1.0.17 is able to open truncated WAV files
    without problem. I've tried with sndfile-play and
    sndfile-open in the libsndfile distribution.