Ejemplo n.º 1
0
 public ModsDemuxer(Stream Stream)
 {
     this.Stream = Stream;
     Header = new ModsHeader(Stream);
     if (Header.AudioOffset != 0)
     {
         AudioCodebooks = new byte[Header.NbChannel][];
         Stream.Position = Header.AudioOffset;
         for (int i = 0; i < Header.NbChannel; i++)
         {
             AudioCodebooks[i] = new byte[0xC34];
             Stream.Read(AudioCodebooks[i], 0, 0xC34);
         }
     }
     KeyFrames = new KeyFrameInfo[Header.KeyframeCount];
     Stream.Position = Header.KeyframeIndexOffset;
     byte[] tmp = new byte[8];
     for (int i = 0; i < Header.KeyframeCount; i++)
     {
         KeyFrames[i] = new KeyFrameInfo();
         Stream.Read(tmp, 0, 8);
         KeyFrames[i].FrameNumber = IOUtil.ReadU32LE(tmp, 0);
         KeyFrames[i].DataOffset = IOUtil.ReadU32LE(tmp, 4);
     }
     JumpToKeyFrame(0);
 }
Ejemplo n.º 2
0
 public ModsDemuxer(Stream Stream)
 {
     this.Stream = Stream;
     Header      = new ModsHeader(Stream);
     if (Header.AudioOffset != 0)
     {
         AudioCodebooks  = new byte[Header.NbChannel][];
         Stream.Position = Header.AudioOffset;
         for (int i = 0; i < Header.NbChannel; i++)
         {
             AudioCodebooks[i] = new byte[0xC34];
             Stream.Read(AudioCodebooks[i], 0, 0xC34);
         }
     }
     KeyFrames       = new KeyFrameInfo[Header.KeyframeCount];
     Stream.Position = Header.KeyframeIndexOffset;
     byte[] tmp = new byte[8];
     for (int i = 0; i < Header.KeyframeCount; i++)
     {
         KeyFrames[i] = new KeyFrameInfo();
         Stream.Read(tmp, 0, 8);
         KeyFrames[i].FrameNumber = IOUtil.ReadU32LE(tmp, 0);
         KeyFrames[i].DataOffset  = IOUtil.ReadU32LE(tmp, 4);
     }
     JumpToKeyFrame(0);
 }