예제 #1
0
        /// <summary>
        /// Called when fundamental frequency is calculated. Than frequency is converted into pitch.
        /// </summary>
        /// <param name="o"></param>
        /// <param name="e"></param>
        private void OnFundamentalFrequencyDetected(object o, FundamentalFrequencyDectectedEventArgs e)
        {
            float frequency = e.Frequency;
            var   pitch     = pitchConverter.GetPitch(frequency);

            detectedPitch = pitch.Item1;
            error         = pitch.Item2;
            OnPitchFound();
        }
예제 #2
0
        /// <summary>
        /// Raised when frequency buffer is filled and fundamental frequency is estimated.
        /// </summary>
        protected virtual void OnFundamentalFrequencyDetected()
        {
            var e = new FundamentalFrequencyDectectedEventArgs()
            {
                Frequency = fundamentalFrequency
            };

            FundamentalFrequencyDetected?.Invoke(this, e);
        }