public ExtSoundHeader(IntPtr pSH) : this() { if (pSH == IntPtr.Zero) return; Init(ref pSH); numFrames = (uint)Marshal.ReadInt32(pSH); pSH = (IntPtr)(pSH.ToInt32() + 4); AIFFSampleRate = new extended80(pSH); pSH = (IntPtr)(pSH.ToInt32() + 10); markerChunk = Marshal.ReadIntPtr(pSH); pSH = (IntPtr)(pSH.ToInt32() + 4); instrumentChunks = Marshal.ReadIntPtr(pSH); pSH = (IntPtr)(pSH.ToInt32() + 4); AESRecording = Marshal.ReadIntPtr(pSH); pSH = (IntPtr)(pSH.ToInt32() + 4); sampleSize = (ushort)Marshal.ReadInt16(pSH); pSH = (IntPtr)(pSH.ToInt32() + 2); futureUse1 = 0; pSH = (IntPtr)(pSH.ToInt32() + 2); futureUse2 = 0; pSH = (IntPtr)(pSH.ToInt32() + 4); futureUse3 = 0; pSH = (IntPtr)(pSH.ToInt32() + 4); futureUse4 = 0; pSH = (IntPtr)(pSH.ToInt32() + 4); if (IntPtr.Zero == samplePtr) { sampleArea = new byte[numFrames * numChannels * (sampleSize / 8)]; samplePtr = pSH; Marshal.Copy(pSH, sampleArea, 0, (int)(numFrames * numChannels * (sampleSize / 8))); } }
public CmpSoundHeader(IntPtr pSH) : this() { if (pSH == IntPtr.Zero) return; Init(ref pSH); numFrames = (uint)Marshal.ReadInt32(pSH); pSH = (IntPtr)(pSH.ToInt32() + 4); AIFFSampleRate = new extended80(pSH); pSH = (IntPtr)(pSH.ToInt32() + 10); markerChunk = Marshal.ReadIntPtr(pSH); pSH = (IntPtr)(pSH.ToInt32() + 4); format = (uint)Marshal.ReadInt32(pSH); pSH = (IntPtr)(pSH.ToInt32() + 4); futureUse2 = 0; pSH = (IntPtr)(pSH.ToInt32() + 4); stateVars = Marshal.ReadIntPtr(pSH); pSH = (IntPtr)(pSH.ToInt32() + 4); leftOverSamples = Marshal.ReadIntPtr(pSH); pSH = (IntPtr)(pSH.ToInt32() + 4); compressionID = Marshal.ReadInt16(pSH); pSH = (IntPtr)(pSH.ToInt32() + 2); packetSize = (ushort)Marshal.ReadInt16(pSH); pSH = (IntPtr)(pSH.ToInt32() + 2); snthID = (ushort)Marshal.ReadInt16(pSH); pSH = (IntPtr)(pSH.ToInt32() + 2); sampleSize = (ushort)Marshal.ReadInt16(pSH); pSH = (IntPtr)(pSH.ToInt32() + 2); if (IntPtr.Zero == samplePtr) { sampleArea = new byte[numFrames * numChannels * (sampleSize / 8)]; samplePtr = pSH; Marshal.Copy(pSH, sampleArea, 0, (int)(numFrames * numChannels * (sampleSize/8))); } }
public uint futureUse4; /*reserved by Apple*/ public ExtSoundHeader() : base() { numFrames = 0; AIFFSampleRate = null; markerChunk = IntPtr.Zero; instrumentChunks = IntPtr.Zero; AESRecording = IntPtr.Zero; sampleSize = 0; futureUse1 = 0; futureUse2 = 0; futureUse3 = 0; futureUse4 = 0; }
public ushort sampleSize; /*number of bits in non-compressed sample*/ public CmpSoundHeader() : base() { numFrames = 0; AIFFSampleRate = null; markerChunk = IntPtr.Zero; format = 0; futureUse2 = 0; stateVars = IntPtr.Zero; leftOverSamples = IntPtr.Zero; compressionID = 0; packetSize = 0; snthID = 0; sampleSize = 0; }