That's a handy command, but I'm certain it won't work 100% for the file in question. The chunks in that bad file claim the extra two bytes are part of the file, so a wav format parser could come up short. You have to edit existing data in the file in two places before shortening the file - truncating the file is not enough by itself.

The real problem is that the file was stereo, but had an odd number of samples. When FLAC complains about a "partial sample" it means there is a left channel sample without a right channel sample to go with it - a better term might be "partial frame" if you define a sample frame as a group of samples for every channel. The fixed file created by SoundForge either dropped the last sample from the left channel, or added a zero sample to complete the right channel.

The long explanation that I gave yesterday, although accurate in itself, did not precisely apply to the bad file in question.

Brian Willoughby
Sound Consulting


On Nov 2, 2007, at 12:39, Dat Head wrote:

dd if=$file ibs=1 count=$(($(stat --printf='%s' $file)-2)) of=$file.new

of course if you run this on one of the files that doesn't have the
extra 2 bytes
you're gonna lose something you didn't want to

On 11/1/07, Alex Brims <[EMAIL PROTECTED]> wrote:
Ok, we actually worked this out - there were 2 extra bytes doing nothing at the end of the files. Opening the file in SoundForge and saving it (without changing it) took off the extra bytes and allowed the file to convert to
FLAC.

Thanks to everyone who emailed me suggestions.

Is there a decent program for linux that could automatically take these bytes off, without running the risk of removing good data? Or is there a way to get the flac converter to ignore this error and create the file? I'm
running flac 1.2.1 on Red Hat Enterprise Linux ES release 4.

_______________________________________________
Flac mailing list
[email protected]
http://lists.xiph.org/mailman/listinfo/flac

Reply via email to