コード例 #1
0
 private static void DescribeChunk(RiffChunk chunk, StringBuilder stringBuilder, byte[] data)
 {
     switch(chunk.IdentifierAsString)
     {
         case "strc":
             DescribeStrc(stringBuilder, data);
             break;
         case "bext":
             DescribeBext(stringBuilder, data);
             break;
         case "iXML":
             stringBuilder.Append(UTF8Encoding.UTF8.GetString(data));
             break;
         default:
             {
                 if (ByteArrayExtensions.IsEntirelyNull(data))
                 {
                     stringBuilder.AppendFormat("{0} null bytes\r\n", data.Length);
                 }
                 else
                 {
                     stringBuilder.AppendFormat("{0}\r\n", ByteArrayExtensions.DescribeAsHex(data," ",32));
                 }
             }
             break;
     }
 }
コード例 #2
0
 /// <summary>
 /// Gets the data for the specified chunk
 /// </summary>
 public byte[] GetChunkData(RiffChunk chunk)
 {
     long oldPosition = waveStream.Position;
     waveStream.Position = chunk.StreamPosition;
     byte[] data = new byte[chunk.Length];
     waveStream.Read(data, 0, data.Length);
     waveStream.Position = oldPosition;
     return data;
 }
コード例 #3
0
        /// <summary>
        /// Gets the data for the specified chunk
        /// </summary>
        public byte[] GetChunkData(RiffChunk chunk)
        {
            long oldPosition = waveStream.Position;

            waveStream.Position = chunk.StreamPosition;
            byte[] data = new byte[chunk.Length];
            waveStream.Read(data, 0, data.Length);
            waveStream.Position = oldPosition;
            return(data);
        }
コード例 #4
0
ファイル: WaveFileReader.cs プロジェクト: h4ltYu/EOS
        /// <summary>
        /// Gets the data for the specified chunk
        /// </summary>
        // Token: 0x06000AEF RID: 2799 RVA: 0x000205E8 File Offset: 0x0001E7E8
        public byte[] GetChunkData(RiffChunk chunk)
        {
            long position = this.waveStream.Position;

            this.waveStream.Position = chunk.StreamPosition;
            byte[] array = new byte[chunk.Length];
            this.waveStream.Read(array, 0, array.Length);
            this.waveStream.Position = position;
            return(array);
        }
コード例 #5
0
ファイル: WaveFileInspector.cs プロジェクト: Punloeu/karaoke
 private static void DescribeChunk(RiffChunk chunk, StringBuilder stringBuilder, byte[] data)
 {
     switch(chunk.IdentifierAsString)
     {
         case "strc":
             DescribeStrc(stringBuilder, data);
             break;
         default:
             {
                 int n = 0;
                 foreach (byte b in data)
                 {
                     stringBuilder.AppendFormat("{0:X2} ", b);
                     if (++n % 8 == 0)
                         stringBuilder.Append("\r\n");
                 }
                 stringBuilder.Append("\r\n");
             }
             break;
     }
 }