Author Topic: Output seems incompatible with libsndfile  (Read 325 times)

sciss

  • Full Member
  • ***
  • Posts: 13
    • View Profile
Output seems incompatible with libsndfile
« on: March 11, 2017, 05:34:19 PM »
Hi,

I'm getting libsndfile errors playing back a generated file with SuperCollider. It looks like this:

File '/data/audio_work/out.wav' could not be opened: Error in WAV file. No 'data' chunk marker.

I can open the file in my own software and rewrite it into a "clean" file, and then it works.

More info:

$ sndfile-info /data/audio_work/out.wav
Error : Not able to open input file /data/audio_work/out.wav.
File : /data/audio_work/out.wav
Length : 2872680
RIFF : 2872672
WAVE
fmt  : 16
  Format        : 0x1 => WAVE_FORMAT_PCM
  Channels      : 2
  Sample Rate   : 48000
  Block Align   : 4
  Bit Width     : 16
  Bytes/sec     : 192000
PEAK : 24
  version    : 1
  time stamp : 1489253433
    Ch   Position       Value
     0   50682          0.518669
     1   30869          0.501828
cue  : 28
  Count : 1
   Cue ID : 1718183539  Pos :     0  Chunk : data  Chk Start : 0  Blk Start : 0  Offset :     0
LIST : 2016
  adtl
  *** note : 2004 (too big)
Have 0 marker at position 2148 (0x864).

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

sciss

  • Full Member
  • ***
  • Posts: 13
    • View Profile
Re: Output seems incompatible with libsndfile
« Reply #1 on: March 11, 2017, 05:35:41 PM »
Sorry, I forgot to mention how the file was created:

    ./reverb /data/audio_work/test.wav /data/audio_work/out.wav 1 0 10 0.5 0 5

sciss

  • Full Member
  • ***
  • Posts: 13
    • View Profile
Re: Output seems incompatible with libsndfile
« Reply #2 on: March 11, 2017, 06:44:38 PM »
N.B. AIFF output files seem fine.

rwdobson

  • Sr. Member
  • ****
  • Posts: 69
    • View Profile
Re: Output seems incompatible with libsndfile
« Reply #3 on: March 13, 2017, 05:00:36 PM »
The libsndfile report seems to show that the file only extends to the end of the (large) header chunk, hence no "data" chunk. This can happen if the program aborts prematurely for some reason before writing any audio. I can't reproduce the problem here (reverb runs to completion using those arguments). Is the length of the file (as shown by the OS) what would be expected? CDP programs use a header (whether WAVE or AIFF) much larger than a typical "minimum"  header, something over 2Kbytes.