libsndfile / libsndfile

A C library for reading and writing sound files containing sampled audio data.
http://libsndfile.github.io/libsndfile/
GNU Lesser General Public License v2.1
1.45k stars 383 forks source link

Error parsing/loading .wav files recorded with a Zoom R8 #374

Closed x42 closed 1 year ago

x42 commented 6 years ago

This is a follow-up of #370

A file recorded with a Zoom, anonymized by zeroing audio-data after 0x00060010 (audio-data starts at 0x00060000): http://robin.linuxaudio.org/tmp/zoom_sndfile_bug.wav.gz

with libsndfile-1.0.27:

File : zoom_sndfile_bug.wav
Length : 27293176
RIFF : 27293168
WAVE
fmt  : 16
  Format        : 0x1 => WAVE_FORMAT_PCM
  Channels      : 1
  Sample Rate   : 44100
  Block Align   : 2
  Bit Width     : 16
  Bytes/sec     : 88200
LIST : 393164 (too long)
data : 26899960
End

----------------------------------------
Sample Rate : 44100
Frames      : 13449980
Channels    : 1
Format      : 0x00010002
Sections    : 1
Seekable    : TRUE
Duration    : 00:05:04.988
Signal Max  : 42 (-57.84 dB)

With libsndfile 1.0.28-115-g65eabcbf (1.0.28 release is also affected):

Error : Not able to open input file /tmp/zoom_sndfile_bug.wav.
File : /tmp/zoom_sndfile_bug.wav
Length : 27293176
RIFF : 27293168
WAVE
fmt  : 16
  Format        : 0x1 => WAVE_FORMAT_PCM
  Channels      : 1
  Sample Rate   : 44100
  Block Align   : 2
  Bit Width     : 16
  Bytes/sec     : 88200
LIST : 393164
    *** ��N
            : 50466568
Request for header allocation of 786320 denied.
*** Unknown chunk marker (19A75F8) at position 393212. Exiting parser.
*** Chunk size 4292673536 > file length 27293176. Exiting parser.

Error in WAV file. No 'data' chunk marker.

PS. the output *** ��N comes from the "%M" in src/wavlike.c:1035, an unhandled default chunk.

PPS. The file plays fine with mplayer, ffmpeg and also older tools using libsndfile1.0.27

sciurius commented 6 years ago

What Zoom device did make this?

x42 commented 6 years ago

Zoom R8 portable recorder