[Flac] Re: Odd number of samples in a stereo wave file

Josh Coalson xflac at yahoo.com
Mon Nov 26 15:27:35 PST 2007


--- Free Lunch <freelunch at gmail.com> wrote:

> On 16/11/2007, Brian Willoughby <brianw at sounds.wa.com> wrote:
> > It would actually be punitive to expect the flac code to expect and
> > adapt to nonsensical WAVE files.
> 
> You say "punitive".  I say it would be "reliable".
> 
> One missing byte is a huge burden and nonsensical?
> 
> People post on this list looking for solutions. They don't want to
> become experts in the WAV format (including the undocumented parts).
> They just want to compress their audio without losing any of the
> original (you know, LOSSLESS).  And if some of their original isn't
> included in the archive, they want an exit code to indicate a problem
> and not that everything is okay.
> 
> Imagine if Sony, Pioneer and other hardware player manufacturers were
> so quick to reject "nonsensical" audio.  Can you imagine if your car
> CD player was so finicky?  How do you think real world customers
would
> react?  They don't want to hear excuses about format, they just want
> a product to work. Sorry if that "just work" expectation is too
> "punitive" for you.

those are playback applications; the difference is that you are talking
about the encoding part of flac which is lossless and most commonly
used for archival.  it cannot fulfill that requirement by making
assumptions about bad input.

I could add some lossy option to define how to handle these cases but
it really does not belong there.  there are no doubt already plenty
of programs to check the correctness of wave files, and a program to
fix the specific case you're talking about is pretty trivial and
probably already exists.

> > If the problem is common, then report the bug to the makers of the
> > programs which produce the bad WAVE files, tell your customers to
> > switch to compliant programs,
> 
> As I have stated before on this list, that is a completely
unrealistic
> fantasy.  I have yet to find a customer who favorably responds to
> being told to change their tools. Dumping the uncooperative vendor is
> generally much easier.  Customers don't want excuses, they want
> solutions.

that's fine, the other option is to find or develop something in-house
to clean up the files.  flac.exe is already too complicated and can't
be everything for everyone (I've already started deprecating and
removing things that really don't belong in it).  if you can't find or
make something to repair the bad wavs, you could tweak the flac source
yourself to truncate or insert samples depending on how you want to
handle it.

> And as pointed out before, sometimes recordings get interrupted.  If
> a recording device loses power it may not be able to write an even
> number of bytes or update the header size.

these files have correct header sizes so it is almost certainly a bug,
not just a truncation problem.

> > and/or write your own software which
> > processes WAVE files looking for these kinds of errors and repairs
> > them.  If you receive the files via uploads, it would probably be
> > possible to have this step run automatically.
> 
> For many of us who produce terabytes of audio masters, modifying them
> is not an option.  The potential for introducing flaws is too great.
> Simply stating "reject them" is not a solution.

but flac has to modify them (although just in memory) to encode them.

I feel your pain but it basically comes down to whether it should be
in flac or outside it.

Josh



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs


More information about the Flac mailing list