Re: What is the magic code for Ogg FLAC?

"Martin Leese" <[email protected]>
Newsgroups gmane.comp.audio.compression.flac.user
Message-ID <[email protected]>
Josh Coalson <[email protected]> wrote:

> I think everything you need is here:
> http://flac.sourceforge.net/ogg_mapping.html

" Ivo Emanuel Gon?alves " <[email protected]> wrote:

> I'd say it had enough info, but too much for what I needed.  I ended
> up finding the answer in oggenc/flac.c: it's "\177FLAC" not "fLaC" as
> ogginfo claimed.
>
> Is this right, Josh?  While my patched ogginfo now detects Ogg FLAC
> properly, I'm not sure if this is the correct method.  ogginfo only
> checks for magic and packet size.

I am not Josh, but this looks straightforward.
>From http://flac.sourceforge.net/ogg_mapping.html:
    Version 1.0 of the FLAC-to-Ogg mapping
    then is a simple identifying header followed by
    pure native FLAC data, as follows:

    * The first packet of a stream consists of:
          o The one-byte packet type 0x7F
          o The four-byte ASCII signature "FLAC",
                i.e. 0x46, 0x4C, 0x41, 0x43

As 0x7F = \177, yes this is right.

Regards,
Martin
-- 
Martin J Leese
E-mail: [email protected]
Web: http://members.tripod.com/martin_leese/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.