[flac-dev] Commonly getting FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA on valid audio

Collin collin at gobbler.com
Fri Feb 8 14:22:21 PST 2013

Erik de Castro Lopo <mle+la <at> mega-nerd.com> writes:

> Collin wrote:
> > Has anyone encountered a similar problem, or are there any known issues that
> > could explain this?
> No known issues of this kind, but I would like to see a repeatable test
> case so I can investigate further.
> Cheers,
> Erik

It turns out it was an error on my part; sorry for the trouble. I misunderstood
the format libflac was expecting my samples in. I found the wording in the
documentation very confusing.

My audio file has 2 channels and 16-bit samples, so I have to pull out each
individual sample, push it into a FLAC__int32, and fix endian-ness before I can
pass it to libflac.

The documentation made me think that libflac just wanted me to shove my 2-byte
sample into a FLAC__int32. I wasn't aware that it wanted me to extend the sign,
as well.

More information about the flac-dev mailing list