template "Dalet Sound File Format (BWF)" description "Structure of Dalet BWF soundfile header" applies_to file fixed_start 0x00 requires 0x00 "52 49 46 46" // "RIFF" requires 0x08 "57 41 56 45" // "WAVE" requires 0x0C "62 65 78 74" // "bext" // Template by Steven Scholte, based on template by Khomenko Volodymyr. // This template describes the BWF file format by the EBU. // Dalet can use this as a format for writing sound files (lineair and // MPEG audio). // Note that this template relies on the ordering of the chunks // as used by Dalet. The BWF format does not specify the exact ordering, // so you may need to edit the template for use with BWF files written // by other applications. begin section "RIFF Chunk" read-only char[4] "ckID[4]" uint32 "ckSize" read-only char[4] "form[4]" endsection section "Broadcast Extension Chunk" read-only char[4] "ckID[4]" uint32 "BEXTckSize" char[256] "Description" char[32] "Originator (Name)" char[32] "OriginatorReference (Reference)" char[10] "OriginationDate (yyyy-mm-dd)" char[8] "OriginationTime (hh:mm:ss)" uint32 "TimeReferenceLow (First sample count since midnight low word)" uint32 "TimeReferenceHigh (First sample count since midnight high word)" uint16 "Version (Version of the BWF)" hex 64 "UMID (Binary bytes of SMPTE UMID)" hex 190 "Reserved" char[256] "CodingHistory" endsection // Sometimes the CodingHistory field is shorter then 256 bytes... move BEXTckSize move -858 section "Format Chunk" read-only char[4] "ckID[4]" uint32 "ckSize" uint16 "wFormatTag" uint16 "nChannels (Number of channels)" uint32 "nSamplesPerSec (Sampling rate)" uint32 "nAvgBytesPerSec (For buffer estimation)" uint16 "nBlockAlign (Data block size)" uint16 "wBitsPerSample (Bits per sample)" uint16 "cbSize" IfEqual cbSize 22 uint16 "fwHeadLayer (MPEG audio layer)" uint32 "dwHeadBitrate (Total bits per second)" uint16 "fwHeadMode (Stream mode)" uint16 "fwHeadModeExt (Extra parameters for JS coding)" uint16 "wHeadEmphasis (Emphasis)" uint16 "fwHeadFlags (MPEG flags)" uint32 "dwPTSLow (Presentation Time Stamp Low)" uint32 "dwPTSHigh (Presentation Time Stamp High)" EndIf endsection section "Fact Chunk" read-only char[4] "ckID[4]" uint32 "ckSize" uint32 "dwFileSize (Time length of the data in samples)" endsection // If the file contains MPEG audio a mext chunk is also added IfEqual wFormatTag 80 // 0x0050=WAVE_FORMAT_MPEG section "MPEG Audio Extension Chunk" read-only char[4] "ckID[4]" uint32 "ckSize" uint16 "SoundInformation (Additional information about the sound file)" uint16 "FrameSize (Nominal size of a frame)" uint16 "AncillaryDataLength (Ancillary data length)" uint16 "AncillaryDataDef (Type of ancillary data)" read-only hex 4 "Reserved" endsection EndIf section "Data Chunk" read-only char[4] "ckID[4]" uint32 "ckSize" endsection end