當前位置: 首頁>>代碼示例>>C#>>正文


C# WaveFileReader.GetChunkData方法代碼示例

本文整理匯總了C#中NAudio.Wave.WaveFileReader.GetChunkData方法的典型用法代碼示例。如果您正苦於以下問題:C# WaveFileReader.GetChunkData方法的具體用法?C# WaveFileReader.GetChunkData怎麽用?C# WaveFileReader.GetChunkData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NAudio.Wave.WaveFileReader的用法示例。


在下文中一共展示了WaveFileReader.GetChunkData方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Describe

 public string Describe(string fileName)
 {
     StringBuilder stringBuilder = new StringBuilder();
     using (WaveFileReader wf = new WaveFileReader(fileName))
     {
         stringBuilder.AppendFormat("{0} {1}Hz {2} channels {3} bits per sample\r\n", 
             wf.WaveFormat.Encoding, wf.WaveFormat.SampleRate,
             wf.WaveFormat.Channels, wf.WaveFormat.BitsPerSample);
         stringBuilder.AppendFormat("Extra Size: {0} Block Align: {1} Average Bytes Per Second: {2}\r\n",
             wf.WaveFormat.ExtraSize, wf.WaveFormat.BlockAlign,
             wf.WaveFormat.AverageBytesPerSecond);
         stringBuilder.AppendFormat("WaveFormat: {0}\r\n",wf.WaveFormat);
         
         stringBuilder.AppendFormat("Length: {0} bytes: {1} \r\n", wf.Length, wf.TotalTime);
         foreach (RiffChunk chunk in wf.ExtraChunks)
         {
             stringBuilder.AppendFormat("Chunk: {0}, length {1}\r\n", chunk.IdentifierAsString, chunk.Length);
             byte[] data = wf.GetChunkData(chunk);
             DescribeChunk(chunk, stringBuilder, data);
         }
     }
     return stringBuilder.ToString();
 }
開發者ID:jithuin,項目名稱:infogeezer,代碼行數:23,代碼來源:WaveFileInspector.cs

示例2: FromChunks

        /// <summary>
        /// Checks if the cue and list chunks exist and if so, creates a cue list
        /// </summary>
        internal static CueList FromChunks(WaveFileReader reader)
        {
            CueList cueList = null;
            byte[] cueChunkData = null;
            byte[] listChunkData = null;

            foreach (RiffChunk chunk in reader.ExtraChunks)
            {
                if (chunk.IdentifierAsString.ToLower() == "cue ")
                {
                    cueChunkData = reader.GetChunkData(chunk);
                }
                else if (chunk.IdentifierAsString.ToLower() == "list")
                {
                    listChunkData = reader.GetChunkData(chunk);
                }
            }
            if (cueChunkData != null && listChunkData != null)
            {
                cueList = new CueList(cueChunkData, listChunkData);
            }
            return cueList;
        }
開發者ID:hanistory,項目名稱:hasuite,代碼行數:26,代碼來源:CueList.cs


注:本文中的NAudio.Wave.WaveFileReader.GetChunkData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。