예제 #1
0
 /// <summary>
 /// Create a new WAV file from data. Used mainly in the conversion methods.
 /// </summary>
 /// <param name="header">The header</param>
 /// <param name="fmtChunk">The format info</param>
 /// <param name="data">The data</param>
 public WAVFile(WAVHeader header, WAVFormatChunk fmtChunk, WAVDataChunk data)
 {
     Header           = header;
     Format           = fmtChunk;
     Data             = data;
     Header.DataChunk = Data;
     Data.FormatChunk = Format;
 }
예제 #2
0
파일: WAVFile.cs 프로젝트: bull313/Musika
            private readonly string wavFilePath;                                                    /* Path where the WAV file is located                                                   */

            /* / PROPERTIES */


            /* CONSTRUCTOR */

            public WAVFile(OffsetFrequencyDurationTableListMap positionFrequencyDurationTable, string wavFilePath, string wavFilename)
            {
                data = new WAVDataChunk();

                this.positionFrequencyDurationTable = positionFrequencyDurationTable;
                this.wavFilePath = wavFilePath;
                this.wavFilename = wavFilename;
            }
예제 #3
0
        /// <summary>
        /// Create a new WEM file from the specified path.
        /// </summary>
        /// <param name="path">The WEM file.</param>
        public WAVFile(string path)
        {
            using (FileStream inputStream = new FileStream(path, FileMode.Open)) {
                BinaryReader reader = new BinaryReader(inputStream);

                Header           = WAVHeader.CreateFromStream(reader);
                Format           = WAVFormatChunk.CreateFromStream(reader);
                Data             = WAVDataChunk.CreateFromStream(reader, Format);
                Header.DataChunk = Data;

                reader.Dispose();
            }
        }