[Flac-dev] Setting compression level
xflac at yahoo.com
Tue Dec 12 16:26:34 PST 2006
--- Petr <petrcbr at simracing.cz> wrote:
> I'm have a little problem with setting compression level since 1.1.3
> I'm using :
> FE = FLAC__stream_encoder_new();
> FLAC__stream_encoder_set_channels( FE, channels);
> FLAC__stream_encoder_set_bits_per_sample( FE, bitsample);
> FLAC__stream_encoder_set_sample_rate( FE, samplerate);
> unsigned int level;
> if (formatdatalen>0)
> level = *(char*)(formatdata);
> level = 7;
> if (level>=0 && level<=8)
> if (!FLAC__stream_encoder_set_compression_level( FE, level))
> return -1;
> if (FLAC__stream_encoder_init_stream( FE, WriteCallback,
> TellCallback, NULL, destination) != FLAC__STREAM_ENCODER_OK)
> return -1;
> and sending stream to encode ....
> I can set any compression level (default i have 7), but final FLAC
> always have same size as source WAV file. FLAC is playable, but not
> compressed. Is there must be any additional settings ?
that looks fine. I don't think it's the compression level setting.
try without calling that function at all, the encoder will default
to compression level 0, which should still give some compression.
usually the problem is in the way the samples are formatted and
passed to FLAC__stream_encoder_process(). I'd have to see that
code to debug. see also
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
More information about the Flac-dev