コード例 #1
0
ファイル: SampleDataAsset.cs プロジェクト: eriser/alphaSynth
        public SampleDataAsset(SampleHeader sample, SoundFontSampleData sampleData)
        {
            Channels = 1;

            Name = sample.Name;
            SampleRate = sample.SampleRate;
            RootKey = sample.RootKey;
            Tune = sample.Tune;
            Start = sample.Start;
            End = sample.End;
            LoopStart = sample.StartLoop;
            LoopEnd = sample.EndLoop;
            SampleData = PcmData.Create(sampleData.BitsPerSample, sampleData.SampleData, true);
        }
コード例 #2
0
ファイル: SoundFont.cs プロジェクト: eriser/alphaSynth
        public void Load(IReadable input)
        {
            var id = input.Read8BitChars(4);
            var size = input.ReadInt32LE();
            if (id.ToLower() != "riff")
                throw new Exception("Invalid soundfont. Could not find RIFF header.");
            id = input.Read8BitChars(4);
            if (id.ToLower() != "sfbk")
                throw new Exception("Invalid soundfont. Riff type is invalid.");

            Logger.Debug("Reading info chunk");
            Info = new SoundFontInfo(input);
            Logger.Debug("Reading sampledata chunk");
            SampleData = new SoundFontSampleData(input);
            Logger.Debug("Reading preset chunk");
            Presets = new SoundFontPresets(input);
        }
コード例 #3
0
ファイル: SoundFont.cs プロジェクト: zwdesigns/alphaSynth
        public void Load(IReadable input)
        {
            var id   = input.Read8BitChars(4);
            var size = input.ReadInt32LE();

            if (id.ToLower() != "riff")
            {
                throw new Exception("Invalid soundfont. Could not find RIFF header.");
            }
            id = input.Read8BitChars(4);
            if (id.ToLower() != "sfbk")
            {
                throw new Exception("Invalid soundfont. Riff type is invalid.");
            }

            Logger.Debug("Reading info chunk");
            Info = new SoundFontInfo(input);
            Logger.Debug("Reading sampledata chunk");
            SampleData = new SoundFontSampleData(input);
            Logger.Debug("Reading preset chunk");
            Presets = new SoundFontPresets(input);
        }