ReadHeader() public static method

Wave ファイルストリームからヘッダを読み出す。
public static ReadHeader ( BinaryReader reader ) : FormatHeader
reader System.IO.BinaryReader 読み出し元のストリーム
return FormatHeader
示例#1
0
        /// <summary>
        /// Wave ファイルを開く。
        /// </summary>
        /// <param name="reader">Wave ファイルを格納したストリーム</param>
        public void Open(BinaryReader reader)
        {
            if (this.reader != null)
            {
                this.reader.Close();
            }

            this.reader = reader;

            // ヘッダ読み出し
            this.header = WaveReader.ReadHeader(reader);

            if (this.header.id != 0x0001)
            {
                throw new WaveException("対応していないフォーマットです。");
            }

            // data chunk 読み出し
            int length = ReadDataChunk(reader);

            this.dataLength = (uint)(length / this.header.blockSize);
        }        //Open