[Flac] Flac woes

Dat Head dathead2 at gmail.com
Tue Jun 12 13:16:40 PDT 2007


here was a quick hack i put together for same issue, be sure to
back up your files beforehand!  unix/linux only obviously ;-)

#
#       sfoddfix - Sound File ODD size FIXer
#
# NOTE: flac v1.1.2 pukes on files that have an odd byte count, this pads them

files=${*:-*.wav}

for file in $files
do
  size=$(stat --printf='%s' $file)
  if [ $(($size%2)) -ne 0 ]; then
    echo "size=$size"
    echo "echo -e \"\\0377\\c\" >> $file"
    echo -e "\0377\c" >> $file
  fi
done

> By the way, the padding that is required is only a single byte.  All
> WAV chunks, whether audio or not, must have an even number of bytes,
> and be aligned to 16-bit word boundaries.  This is only difficult
> with 8-bit and 24-bit audio, and I assume you are recording at 24-
> bit.


More information about the Flac mailing list