示例#1
0
        private void Capturer_NewPick(object sender, AudioPickEventArgs e)
        {
            var test = SoundCalculator.GetFrequencyModel(e.pickData);

            samples.Add(SoundCalculator.GetSampleFromModel(test, testedNote));
            samplesOneType++;
            lbSampleCount.Content    = samplesOneType;
            lbAllSampleCount.Content = samples.Count;
        }
        private void Capturer_NewPick(object sender, AudioPickEventArgs e)
        {
            if (DateTime.Now - lastSound > new TimeSpan(0, 0, 0, 0, 150))
            {
                var            t0   = DateTime.Now;
                FrequencyModel test = new FrequencyModel(new Dictionary <float, float>());
                Task           t    = Task.Factory.StartNew(() => { test = SoundCalculator.GetFrequencyModel(e.pickData); });
                renderer.Render(e.pickData, 0);
                t.Wait();
                appInfo.SetFrequency(test.FirstTone);
                Note n = noteFinder.getNoteFromModel(test);
                appInfo.SetNote(n);

                testSong.AddNote(n, t0);
            }
            lastSound = DateTime.Now;
        }