Help - Search - Members - Calendar
Full Version: Encoding through errors
Hydrogenaudio Forums > Lossless Audio Compression > FLAC
Tene
How does one encode through wav errors? I've cat'ed three videos and demuxed the audio (pcm_u8), but when encoding with flac it throws an error near the end:
QUOTE

flac file.wav -o 30.flac

flac 1.2.1, Copyright © 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. Type `flac' for details.

file.wav: 97% complete, ratio=0.664file.wav: ERROR during read of data pad byte


I've tried all the vaguely related switches:
QUOTE

flac --decode-through-errors --no-verify --no-warnings-as-errors file.wav -o 30.flac

flac 1.2.1, Copyright © 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. Type `flac' for details.

file.wav: 97% complete, ratio=0.664file.wav: ERROR during read of data pad byte

Is there any way at all to either discard the corrupt data (shorten doesn't seem to think it's corrupt unsure.gif) or fix it?

Edit:
I downloaded flac 1.1.2a for Windows and ran it with wine, which gives more a more verbose error:
QUOTE
wine ../flac.exe file.wav -o z.flac

flac 1.1.2, Copyright © 2000,2001,2002,2003,2004,2005 Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. Type `flac' for details.

options: -P 4096 -b 4608 -m -l 8 -q 0 -r 3,3
file.wav: ERROR: unsupported block alignment (4), for bits-per-sample=8, channels=1

Anyone at all?

Edit 2:
After looking around, I think I have to change the block alignment to 1, but I have no idea how dry.gif
Justin Ruggles
QUOTE(Tene @ Nov 13 2007, 11:05) *

Edit 2:
After looking around, I think I have to change the block alignment to 1, but I have no idea how dry.gif


I don't think that's really the problem. Judging from the error message, the 'data' chunk is not word-aligned. So you need to add a single byte to the end of your file. There are numerous ways to do this. Judging from the fact that you used wine to run a Windows FLAC binary, I'm guessing that you use Linux? If so, you can do this:
dd if=/dev/zero of=onebyte bs=1 count=1
cat file.wav onebyte > file_fixed.wav

Hope that helps.
Tene
QUOTE(Justin Ruggles @ Nov 15 2007, 00:57) *

QUOTE(Tene @ Nov 13 2007, 11:05) *

Edit 2:
After looking around, I think I have to change the block alignment to 1, but I have no idea how dry.gif


I don't think that's really the problem. Judging from the error message, the 'data' chunk is not word-aligned. So you need to add a single byte to the end of your file. There are numerous ways to do this. Judging from the fact that you used wine to run a Windows FLAC binary, I'm guessing that you use Linux? If so, you can do this:
dd if=/dev/zero of=onebyte bs=1 count=1
cat file.wav onebyte > file_fixed.wav

Hope that helps.

It did indeed smile.gif. Thank you!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.