コード例 #1
0
 private void Load(Stream stream)
 {
     using (BinaryReader reader = new BinaryReader(stream))
     {
         string id = new string(IOHelper.Read8BitChars(reader, 4));
         int size = reader.ReadInt32();
         if (!id.ToLower().Equals("riff"))
             throw new Exception("Invalid soundfont. Could not find RIFF header.");
         id = new string(IOHelper.Read8BitChars(reader, 4));
         if (!id.ToLower().Equals("sfbk"))
             throw new Exception("Invalid soundfont. Riff type is invalid.");
         info = new SoundFontInfo(reader);
         data = new SoundFontSampleData(reader);
         presets = new SoundFontPresets(reader);
     }
 }
コード例 #2
0
ファイル: SoundFont.cs プロジェクト: raynler/DoomUnity
 private void Load(Stream stream)
 {
     using (BinaryReader reader = new BinaryReader(stream))
     {
         string id = new string(IOHelper.Read8BitChars(reader, 4));
         if (!id.ToLower().Equals("riff"))
         {
             throw new Exception("Invalid soundfont. Could not find RIFF header.");
         }
         id = new string(IOHelper.Read8BitChars(reader, 4));
         if (!id.ToLower().Equals("sfbk"))
         {
             throw new Exception("Invalid soundfont. Riff type is invalid.");
         }
         info    = new SoundFontInfo(reader);
         data    = new SoundFontSampleData(reader);
         presets = new SoundFontPresets(reader);
     }
 }