Inheritance: IDisposable
コード例 #1
0
 private static void LoadAssetData()
 {
     for (int x = 0; x < patches.Count; x++)
     {
         for (int y = 0; y < patches[x].Description.GenDescriptions.Length; y++)
         {
             GeneratorDescriptor genDesc = patches[x].Description.GenDescriptions[y];
             string assetName = genDesc.AssetName;
             string extension = Path.GetExtension(assetName).ToLower();
             if (genDesc.SamplerType == WaveformEnum.SampleData && !assetName.Equals("null") && ContainsAsset(assetName, assets) == false)
             {
                 switch (extension)
                 {
                     case ".wav":
                         using (WaveFileReader wr = new WaveFileReader(File.Open(assetPath + assetName, FileMode.Open, FileAccess.Read)))
                         {
                             assets.Add(new SampleAsset(assetName, wr.ReadWaveFile()));
                         }
                         break;
                     default:
                         throw new Exception(string.Format("Unknown format ({0}), AssetName: {1}, PatchName: {2}", extension, assetName, patches[x].Name));
                 }
             }
         }
     }
 }
コード例 #2
0
 public Chunk[] ReadAllChunks()
 {
     return(WaveFileReader.ReadAllChunks(reader));
 }
コード例 #3
0
 public Chunk ReadNextChunk()
 {
     return(WaveFileReader.ReadNextChunk(reader));
 }
コード例 #4
0
 public WaveFile ReadWaveFile()
 {
     return(new WaveFile(WaveFileReader.ReadAllChunks(reader)));
 }