[Flac-dev] wav to flac corruption

Erik de Castro Lopo erikd-flac at mega-nerd.com
Wed Feb 6 14:34:44 PST 2008


Matthew Davis wrote:

> If I import one of the wav files into Audacity then export them as "16 bit
> PCM" then they encode to flac and play fine.

Ok.

> The files bitrates are currently at 24.

Sorry to be a pedant, but you mean sample bitwidth of 24 rather
than bitrate.

> If I export them from audacity as a 24 or 32 (anything
> higher than 16), flac fails on me. With a bitrate of 24, the file is encoded
> but won't play. With a bitrate of 32, flac says it can't do it.

Looks like this *might* be a bug in the FLAC WAV reading code.

> Questions in no particular order:
> 1) I assume converting from 24 bits to 16 bits results in a loss of
> information, right?

Yes.

> 2) Is there a faster way to convert rather than going in and out of
> audacity.

sndfile-convert from libsndfile.

> 3) Is there a way to make 24 bit files work with flac?

I tried converting a 24 bit WAV using sndfile-convert and it worked
as expected although the output file was 72% of the size of the 
input file. Obviously, sndfile-coonvert uses libsndfile's WAV reading
code.

The sndfile-convert program is part of libsndfile and you can grab the
latest libsndfile pre-release here:

    http://www.mega-nerd.com/tmp/libsndfile-1.0.18pre20.tar.gz

Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"In civilian equipment, such as computers, the number
of components alone makes miniaturization essential if
the computer is to be housed in a reasonable-sized
building." Electronics Oct. 1, 1957, p. 178


More information about the Flac-dev mailing list