[Flac-dev] Legal sample rates

Erik de Castro Lopo erikd-flac at mega-nerd.com
Wed Nov 10 23:08:49 PST 2004


On Wed, 10 Nov 2004 16:08:21 -0800 (PST)
Josh Coalson <xflac at yahoo.com> wrote:

> > Is there someway of figuring out if a sample rate is valid?
> 
> that's the right way.

But it doesn't tell me that the sample rate is invalid it tells
me FLAC__SEEKABLE_STREAM_ENCODER_STREAM_ENCODER_ERROR or
FLAC__STREAM_ENCODER_NOT_STREAMABLE.

> the reason it's being rejected is the encoder is configured to
> obey the subset:
> 
> http://flac.sourceforge.net/format.html#subset
> 
> to encode 11.025 kHz you need to call
> FLAC__seekable_stream_encoder_set_streamable_subset()

OK, from reading the documentation, FLAC is limited to 8 channels
and sample rates other than 11025. However, if I try to create a 
file with too many channels I get an error of

   FLAC__STREAM_ENCODER_INVALID_NUMBER_OF_CHANNELS

which is fine. If I try to create a file at a sample rate of
11025 I get an error of 

    FLAC__SEEKABLE_STREAM_ENCODER_STREAM_ENCODER_ERROR or
    FLAC__STREAM_ENCODER_NOT_STREAMABLE

which says nothing about the sample rate.

Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo  nospam at mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
"Using Java as a general purpose application development language
is like going big game hunting armed with Nerf weapons."
-- Author Unknown


More information about the Flac-dev mailing list