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)); } } } } }
public Chunk[] ReadAllChunks() { return(WaveFileReader.ReadAllChunks(reader)); }
public Chunk ReadNextChunk() { return(WaveFileReader.ReadNextChunk(reader)); }
public WaveFile ReadWaveFile() { return(new WaveFile(WaveFileReader.ReadAllChunks(reader))); }