public void Header()
        {
            Console.WriteLine("ChrunkID: " + ChrunkID);
            Console.WriteLine("ChrunkSize: " + ChrunkSize.ToString());
            Console.WriteLine("Format: " + Format);
            Console.WriteLine("Subchunk1ID: " + Subchunk1ID);
            Console.WriteLine("Subchunk1Size: " + Subchunk1Size.ToString());
            Console.WriteLine("AudioFormat: " + AudioFormat.ToString());
            Console.WriteLine("NumChanels: " + NumChanels.ToString());
            Console.WriteLine("SampleRate: " + SampleRate.ToString());
            Console.WriteLine("ByteRate: " + ByteRate.ToString());
            Console.WriteLine("BlockAlign: " + BlockAlign.ToString());
            Console.WriteLine("BitsPerSample: " + BitsPerSample.ToString());
            Console.WriteLine("Subchunk2ID: " + Subchunk2ID);
            Console.WriteLine("Subchunk2Size: " + Subchunk2Size.ToString());

            /*for (var j = 0; j < Subchunk2Size / 2 / NumChanels; ++j)
             *  for (var i = 0; i < NumChanels; ++i)
             *      Console.WriteLine(Data[i, j].ToString() + " ");*/

            /* for (var j = 0; j < Subchunk2Size / 2 / NumChanels; ++j)
             *   Console.WriteLine(Data[0, j].ToString() + " ");
             * Console.WriteLine("end");*/
        }
        /// <summary>
        /// Returns multiline string with wav file metadata.
        /// </summary>
        /// <returns></returns>
        public string GetMetadataString()
        {
            var sw = new System.IO.StringWriter();

            sw.WriteLine("Nazwa pliku: " + FileName);
            sw.WriteLine("Czas trwania: " + Subchunk2Size / ByteRate + "s");
            sw.WriteLine();
            sw.WriteLine("---- METADATA ----");
            sw.WriteLine("Chunkid: " + System.Text.Encoding.UTF8.GetString(ChunkID));
            sw.WriteLine("Rozmiar: " + ChunkSize.ToString());
            sw.WriteLine("Format: " + System.Text.Encoding.UTF8.GetString(Format));
            sw.WriteLine("Subchunk1 ID: " + System.Text.Encoding.UTF8.GetString(Subchunk1ID));
            sw.WriteLine("Subchunk1 rozmiar: " + Subchunk1Size.ToString());
            sw.WriteLine("Audio format: " + AudioFormat.ToString());
            sw.WriteLine("Kanaly: " + NumChannels.ToString());
            sw.WriteLine("Sample rate: " + SampleRate.ToString());
            sw.WriteLine("Byte rate: " + ByteRate.ToString());
            sw.WriteLine("Block align: " + BlockAlign.ToString());
            sw.WriteLine("Bits per sample: " + BitsPerSample.ToString());
            sw.WriteLine("Subchunk2 ID: " + System.Text.Encoding.UTF8.GetString(Subchunk2ID));
            sw.WriteLine("Subchunk2 rozmiar: " + Subchunk2Size.ToString());

            return(sw.ToString());
        }
Beispiel #3
0
 public override string ToString()
 {
     return(ChunkId + " " + ChunkSize.ToString() + " " + Format + " " + Subchunk1Id + " " + Subchunk1Size.ToString() + " " +
            AudioFormat.ToString() + " " + NumChannels.ToString() + " " + SampleRate.ToString() + " " + ByteRate.ToString() +
            " " + BlockAlign.ToString() + " " + BitPerSample.ToString() + " " + Subchunk2Id + " " + Subchunk2Size);
 }