I'm writing a program that plays FLAC files using the libFLAC API's. Is there a specific way I'm supposed to handle multiple STREAMINFO metadata blocks? For example, should I ignore all but the first, or all but the last? The format spec doesn't mention anything. Thanks, - Brian Waters
As far as I know one and only one SREAMINFO should be present at the beginning of the file: http://flac.sourceforge.net/format.html<http://flac.sourceforge.net/format.html#stream> <http://flac.sourceforge.net/format.html#stream> "A FLAC bitstream consists of the "fLaC" marker at the beginning of the stream, followed by a mandatory metadata block (called the STREAMINFO block), any number of other metadata blocks, then the audio frames." Lorenzo 2010/11/16 Brian Waters <brianmwaters at gmail.com>> I'm writing a program that plays FLAC files using the libFLAC API's. > Is there a specific way I'm supposed to handle multiple STREAMINFO > metadata blocks? > > For example, should I ignore all but the first, or all but the last? > > The format spec doesn't mention anything. > > Thanks, > > - Brian Waters > _______________________________________________ > Flac-dev mailing list > Flac-dev at xiph.org > http://lists.xiph.org/mailman/listinfo/flac-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20101116/d6c7731e/attachment.htm
Brian Willoughby
2010-Nov-16 09:59 UTC
[Flac-dev] How to handle multiple STREAMINFO blocks?
It's certainly best to honor what the specification says. My assumption is that a "stream" could also be a continuous broadcast, not just a file. With a hypothetical server streaming FLAC bitstreams, I would assume that the most recent STREAMINFO is valid until another one comes along. If you're writing a file player, then perhaps you can trust the spec and assume that there will never be more than one. But I suppose it all depends upon which is easier to handle in your code. Some implementations might make it more complicated to ignore spurious STREAMINFO blocks. I'd say do whatever is easiest, and bank on files not having more than one anyway. Brian Willoughby Sound Consulting On Nov 16, 2010, at 00:00, Lorenzo wrote:> As far as I know one and only one STREAMINFO should be present at > the beginning of the file: http://flac.sourceforge.net/format.html > > "A FLAC bitstream consists of the "fLaC" marker at the beginning of > the stream, followed by a mandatory metadata block (called the > STREAMINFO block), any number of other metadata blocks, then the > audio frames." > > 2010/11/16 Brian Waters <brianmwaters at gmail.com> >> I'm writing a program that plays FLAC files using the libFLAC API's. >> Is there a specific way I'm supposed to handle multiple STREAMINFO >> metadata blocks? >> >> For example, should I ignore all but the first, or all but the last? >> >> The format spec doesn't mention anything.