HHD Software  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 

 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Enjoy Your Skills

HHD Software

FLAC

 
Post new topic   Reply to topic    HHD Software Forum Index -> Structure Library
View previous topic :: View next topic  
Author Message
Leo Davidson



Joined: 19 Aug 2008
Posts: 9
Location: London, UK

PostPosted: Sat May 02, 2009 3:37 pm    Post subject: FLAC Reply with quote

This is a structure viewer definition for the FLAC format. (FLAC = Free Lossless Audio Codec.)

It only parses the metadata blocks at the start of the file. The audio frames are not parsed as I have no need to do so. If you need them this will make a good starting point, though.

What is parsed:
  • METADATA_BLOCK_STREAMINFO (from which you can get the sample rate, duration, etc.)
  • METADATA_BLOCK_PADDING (just zero padding between other data)
  • METADATA_BLOCK_APPLICATION (application-specific; shown as just raw data)
  • METADATA_BLOCK_SEEKTABLE (allows FLAC players to jump around in the audio stream)
  • METADATA_BLOCK_VORBIS_COMMENT (the main metadata strings/tags)
  • METADATA_BLOCK_CUESHEET (cue-sheet data for when entire CDs are archived into a single FLAC file)
  • METADATA_BLOCK_PICTURE (album cover art, band photos, etc.; if it's a PNG image then that will be parsed as well, using the PNG sample that comes with Hex Editor Neo)

Something that may be of use to other people, even if they don't care about FLAC, is the 24-bit (three-byte) number type this uses. This is a Big Endian version but it should be obvious how to make a LE version if you need it:

Code:
struct UInt24
{
hidden:
   BYTE Raw[3];
   const Value = (Raw[0]<<16) + (Raw[1]<<8) + Raw[2];
   $print("(Value)", Value + " decimal");
};

struct Example
{
   BYTE b;
        UInt24 Length;
   BYTE Buffer[Length.Value];
};


Hope it's useful to someone!

Download: flac.zip (3KB)

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    HHD Software Forum Index -> Structure Library All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group