Shayne Wissler <[email protected]> wrote: > I have a program that is given a random file and needs to determine > whether it is Vorbis or FLAC. For Vorbis, there are various places > where I can infer that I have a bad stream. But for FLAC, when I call > either FLAC__stream_decoder_process_until_end_of_metadata or > FLAC__stream_decoder_process_single, it searches the entire file > before giving up. I'd like it to stop searching as soon as it loses > sync, or find some better way to detect the file type without scanning > the whole file. Any tips on the best way to do that?
Perhaps I have misunderstood your problem, but is this not what magic numbers are for? For Ogg Vorbis and Ogg FLAC, see: http://wiki.xiph.org/index.php/MIMETypesCodecs#Codecs_Parameter For Native FLAC, see: http://flac.sourceforge.net/documentation_format_overview.html Regards, Martin -- Martin J Leese E-mail: martin.leese stanfordalumni.org Web: http://members.tripod.com/martin_leese/ _______________________________________________ Flac-dev mailing list [email protected] http://lists.xiph.org/mailman/listinfo/flac-dev
