Advertisement
Kitomas

Struct Definition of .mua Header

Dec 23rd, 2022
2,029
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.91 KB | Software | 0 0
  1. struct muaHeader {
  2.   union { //0x00
  3.     //this string is big endian, of course (WARNING: NOT NULL TERMINATED)
  4.     //"MUAL" means little endian byte order; "MUAB" means big endian
  5.     char     magicNumber_s[4];
  6.     //"MUAL"=0x4D55414C, "MUAB"=0x4D554142 (big endian)
  7.     //"MUAL"=0x4C41554D, "MUAB"=0x4241554D (little endian)
  8.     uint32_t magicNumber;
  9.   };
  10.   //0=pulse code modulation; NO extended header
  11.   //1=delta modulation; extended header
  12.   uint8_t  format;       //0x04
  13.   uint8_t  bitsPerSample;//0x05 bit 7='is signed?'; bits 6->0=bits per sample-1
  14.                           //(0 means samples are floats)
  15.   uint16_t numChannels;  //0x06 1=mono, 2=stereo, etc.
  16.   uint64_t dataSize;     //0x08 in bytes, excluding header
  17.   uint64_t numSamples;   //0x10 dataSize / (numChannels*bitsPerSample/8)
  18.   uint32_t sampleRate;   //0x18 in hertz
  19.   uint32_t loopCount;    //0x1C 'play how many times'; 0=infinite loop
  20. };
Tags: SDL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement