[Flac-dev] Legal sample rates

Erik de Castro Lopo erikd-flac at mega-nerd.com
Thu Nov 11 22:51:38 PST 2004


On Thu, 11 Nov 2004 13:33:42 -0800 (PST)
Josh Coalson <xflac at yahoo.com> wrote:

> --- Erik de Castro Lopo <erikd-flac at mega-nerd.com> wrote:
> > 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.
> 
> oh, I meant FLAC__format_sample_rate_is_valid() is the right way
> to check.

Ok, I tried that, but this:

	printf ("\n\n%u -> %d\n%u -> %d\n%u -> %d\n", 
		112, FLAC__format_sample_rate_is_valid(112),
		11025, FLAC__format_sample_rate_is_valid(11025),
		44100, FLAC__format_sample_rate_is_valid(44100));

prints out this:

	112 -> 1
	11025 -> 1
	44100 -> 1

which suggests that both 112 and 11025 are valid samplerates, but when
I use 11025, I get a FLAC__SEEKABLE_STREAM_ENCODER_STREAM_ENCODER_ERROR.

> 11025 is a valid sample rate, but 9 channels is not a valid
> # of channels.
> 
> the FLAC__STREAM_ENCODER_NOT_STREAMABLE error means you are
> violating the "set streamable subset" setting that is in effect.
> 
> I guess FLAC__STREAM_ENCODER_NOT_STREAMABLE could be expanded
> to FLAC__STREAM_ENCODER_NOT_STREAMABLE_BAD_SAMPLE_RATE,
> FLAC__STREAM_ENCODER_NOT_STREAMABLE_BAD_BITS_PER_SAMPLE etc
> but it doesn't seem worth changing the API for.

Without valid feedback fro libflac about why I am getting 
FLAC__STREAM_ENCODER_NOT_STREAMABLE I am completely up the creek 
without a paddle. The current state of affairs prevents me from
supplying the user with accurate information about what they have
done wrong. It means that if I release what I have now users are
going to have something go wrong and not know why. That means they
will end up sending me emails. 

Erik

PS: I seem to be having a great deal of trouble with the xiph.org
    mail server. It seems to be silently deleting some of my emails.
    I sometimes need to resend my emails 2 or 3 times before it
    gets through to the list.
    
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo  nospam at mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
"Python is the most efficient language I've ever used. It's 10 times
better than any of the other tools I have used. It's free, it's
object-oriented, it adapts to everything, it runs on everything. There
is almost an indescribable 'quality without a name' attraction on my
part."   --Bruce Eckel, Author of Thinking in Java


More information about the Flac-dev mailing list