[Flac] Flac woes

Brian Willoughby brianw at sounds.wa.com
Sun Jun 10 12:57:52 PDT 2007


There are not bugs in flac, they are bugs in your Alesis HD24.
What you are asking for are features to be added to flac to fix the  
bugs in your Alesis.
flac is the wrong place to be addressing errors in your Alesis hardware.

A better solution would be a stand-alone program which can patch the  
errors in your WAV files, possibly asking for your choice in which  
way to do so (there is more than one way, and both are not correct),  
and maybe even allowing you to audition the samples that are  
questionable so that you can verify that it is valid audio.  The  
problem with a bad WAV file is that flac cannot decide whether it is  
better to be inclusive or exclusive when there are inconsistencies.   
If you're worried about archival, then you certainly don't want  
automated tools putting bad audio into your backups.

I, too, record live and original audio.  And I ran into the same  
problems.  In my case, I was recording to AIFF, and there were  
padding errors.  I reported the bugs in my recorder, wrote tools to  
patch the old audio files, and eventually upgraded with my recorder  
was fixed by the manufacturer.  I suggest that you report these  
errors to Alesis and see whether they have a firmware upgrade that  
would make the problem go away.  Meanwhile, a standalone tool could  
repair the WAV files and make flac happy.

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.  The specification for WAV requires this padding byte, so if  
Alesis is not generating it, then they are in error.  It is a common  
mistake in both WAV and AIFF file generation.

flac could generate better error messages, and Josh is working on  
this for the padding error.  Perhaps you could suggest that he also  
improve the error message generated when the size in the WAV header  
is less than the total size of the file.  Note, I've seen cases where  
the header was right, and the excess "audio" data was awful noise  
generated by some freeware program.  I noticed the errors in the  
waveform overview of my DAW.  You certainly don't want flac to be  
blindly including these bogus audio samples whenever there is an  
inconsistency.

P.S.  Are you sure that you aren't using some other program to modify  
the Alesis WAV files after they are recorded?  Perhaps an ID3 tag  
generator?  Some other program may be creating the errors.

Brian Willoughby
Sound Consulting


On Jun 10, 2007, at 07:04, Free Lunch wrote:
>> but the wave file seems invalid.  sample data is supposed to be
>> padded to an even number of bytes.
>
> The gotcha here, as I have tried to explain in similar cases before,
> is that we do not live in a perfect world.  Many of us record audio
> and are unable to control whether a piece of hardware crashes and
> leaves the end of a WAV perfectly aligned or padded.  In this case the
> recorder (Alesis hd24) did not crash, it apparently just doesn't pad.
> Since these are original audio masters being backed up, editing them
> isn't a viable option.
>
> The 'other cases' refers to situations where I am unable to use flac
> on WAV files if the WAV header size is different than the actual file
> size.  I had to write some fairly complex/kludgey scripts which (among
> other tests) flac a file and then use metaflac to examine the size of
> the archived file and if it does not exactly match the size of the
> original WAV (minus header), discard the flac. Basically, a whole lot
> of checking to make sure what is in the archive matches the original.
> And very often it does not.
>
> A bug was filed on that a couple years ago but apparently the fix
> didn't make it into 1.1.4.  If the header says the WAV is only 50
> bytes, then flac will only archive 50 bytes and will omit the rest of
> a file.  Oh, your WAV was 1GB? Sorry, that audio is not part of the
> archive. What, you deleted the WAV and only have the flac archive?
> Well, I guess you should have noticed the message that indicated your
> audio was being discarded:
>
> WARNING: skipping unknown sub-chunk 'PAD '
>
> Yep, that's all the warning you get when flac discards potentially
> massive amounts of the original WAV simply because the header doesn't
> match the contents.
>
> It sure would be nice if the flac code made a greater effort to
> archive the WAV, rather than partials.
>
> Also, I get the legacy wave warning very frequently.  It isn't clear
> what the issue is there?
>
> All your effort on flac is greatly appreciated.. Sorry to bitch but
> these are all pretty serious bugs for some of us who produce original
> audio rather than just rip CD collections (never encountered these
> bugs doing that), etc. I could try and kludge the flac code but I
> doubt my hamfisted approach would pass muster.



More information about the Flac mailing list