Example #1
0
 // Token: 0x060002FA RID: 762 RVA: 0x0000B514 File Offset: 0x00009714
 public void ToStream(Stream stream, WaveWriteOptions options)
 {
     if (stream == null)
     {
         throw new ArgumentNullException("stream");
     }
     if (!stream.CanWrite)
     {
         throw new ArgumentNullException("Given Stream cannot write.");
     }
     using (ABinaryWriter abinaryWriter = new ABinaryWriter(stream))
     {
         if (!options.HasFlag(WaveWriteOptions.NoHeader))
         {
             abinaryWriter.WriteString("RIFF");
             abinaryWriter.Write32(this.WrittenSize);
             abinaryWriter.WriteString("WAVE");
             abinaryWriter.WritePadding(4, 0);
         }
         abinaryWriter.WriteString("fmt ");
         abinaryWriter.Write32((this.format == WaveFormat.PCM) ? 16U : 20U);
         abinaryWriter.Write16((ushort)this.format);
         abinaryWriter.Write16(this.channelCount);
         abinaryWriter.Write32(this.sampleRate);
         abinaryWriter.Write32(this.ByteRate);
         abinaryWriter.Write32((uint)this.BlockAlign);
         abinaryWriter.Write32((uint)this.bitsPerSample);
         if (this.format != WaveFormat.PCM)
         {
             abinaryWriter.Write32(0U);
         }
         abinaryWriter.WritePadding(4, 0);
         abinaryWriter.WriteString("data");
         if (this.data == null)
         {
             abinaryWriter.Write32(0U);
         }
         else
         {
             abinaryWriter.WriteS32(this.data.Length);
             abinaryWriter.Write8s(this.data);
         }
         abinaryWriter.WritePadding(4, 0);
     }
 }
Example #2
0
        // Token: 0x0600005E RID: 94 RVA: 0x00002D94 File Offset: 0x00000F94
        public override void ToStream(Stream stream)
        {
            ABinaryWriter abinaryWriter = new ABinaryWriter(stream, Endianness.Big);

            abinaryWriter.WriteUIntVar(base.DeltaTime);
            abinaryWriter.Write8(byte.MaxValue);
            abinaryWriter.Write8((byte)this.Type);
            abinaryWriter.WriteUIntVar((ulong)((long)this.text.Length));
            abinaryWriter.WriteString(this.text);
        }