Exemple #1
0
        /// <summary>
        /// Returns a string representing the structure in little-endian
        /// hexadecimal format.
        /// </summary>
        /// <remarks>
        /// The string generated here is intended to be passed as
        /// CodecPrivateData for Silverlight 2's MediaStreamSource
        /// </remarks>
        /// <returns>
        /// A string representing the structure in little-endia hexadecimal
        /// format.
        /// </returns>
        public string ToHexString()
        {
            string s = WaveFormatExtensible.ToHexString();

            char[] mpeglayer3Data = new char[6 * 4];
            BitTools.ToHexHelper(4, this.Id, 0, mpeglayer3Data);
            BitTools.ToHexHelper(8, this.BitratePaddingMode, 4, mpeglayer3Data);
            BitTools.ToHexHelper(4, this.BlockSize, 12, mpeglayer3Data);
            BitTools.ToHexHelper(4, this.FramesPerBlock, 16, mpeglayer3Data);
            BitTools.ToHexHelper(4, this.CodecDelay, 20, mpeglayer3Data);
            return(s + new string(mpeglayer3Data));
        }
Exemple #2
0
 public string ToHexString()
 {
     char[] chars = new char[36];
     BitTools.ToHexHelper((byte)4, (long)this.FormatTag, 0, chars);
     BitTools.ToHexHelper((byte)4, (long)this.Channels, 4, chars);
     BitTools.ToHexHelper((byte)8, (long)this.SamplesPerSec, 8, chars);
     BitTools.ToHexHelper((byte)8, (long)this.AverageBytesPerSecond, 16, chars);
     BitTools.ToHexHelper((byte)4, (long)this.BlockAlign, 24, chars);
     BitTools.ToHexHelper((byte)4, (long)this.BitsPerSample, 28, chars);
     BitTools.ToHexHelper((byte)4, (long)this.ExtraDataSize, 32, chars);
     return(new string(chars));
 }
 /// <summary>
 /// Returns a string representing the structure in little-endian
 /// hexadecimal format.
 /// </summary>
 /// <remarks>
 /// The string generated here is intended to be passed as
 /// CodecPrivateData for Silverlight 2's MediaStreamSource
 /// </remarks>
 /// <returns>
 /// A string representing the structure in little-endia hexadecimal
 /// format.
 /// </returns>
 public string ToHexString()
 {
     char[] data = new char[9 * 4];
     BitTools.ToHexHelper(4, this.FormatTag, 0, data);
     BitTools.ToHexHelper(4, this.Channels, 4, data);
     BitTools.ToHexHelper(8, this.SamplesPerSec, 8, data);
     BitTools.ToHexHelper(8, this.AverageBytesPerSecond, 16, data);
     BitTools.ToHexHelper(4, this.BlockAlign, 24, data);
     BitTools.ToHexHelper(4, this.BitsPerSample, 28, data);
     BitTools.ToHexHelper(4, this.ExtraDataSize, 32, data);
     return(new string(data));
 }
Exemple #4
0
        public string ToHexString()
        {
            string hexString = this.WaveFormatExtensible.ToHexString();

            char[] chars = new char[24];
            BitTools.ToHexHelper((byte)4, (long)this.Id, 0, chars);
            BitTools.ToHexHelper((byte)8, (long)this.BitratePaddingMode, 4, chars);
            BitTools.ToHexHelper((byte)4, (long)this.BlockSize, 12, chars);
            BitTools.ToHexHelper((byte)4, (long)this.FramesPerBlock, 16, chars);
            BitTools.ToHexHelper((byte)4, (long)this.CodecDelay, 20, chars);
            string str = new string(chars);

            return(hexString + str);
        }