public static MyInMemoryWaveBank Create(AudioEngine engine, string filename) { DataStream ds; using (FileStream fs = File.OpenRead(filename)) { ds = new DataStream((int)fs.Length, true, true); fs.CopyTo(ds); ds.Position = 0; } var result = new MyInMemoryWaveBank(engine, ds); result.m_backingStore = ds; return result; }
public static MyInMemoryWaveBank Create(AudioEngine engine, string filename) { DataStream ds; using (FileStream fs = File.OpenRead(filename)) { ds = new DataStream((int)fs.Length, true, true); fs.CopyTo(ds); ds.Position = 0; } var result = new MyInMemoryWaveBank(engine, ds); result.m_backingStore = ds; return(result); }