Example #1
0
 private void SingleBlockNotificationStreamOnSingleBlockRead(object sender, SingleBlockReadEventArgs e)
 {
     _graphVisualization.AddSamples(e.Left, e.Right);
 }
Example #2
0
        private void OnNotifyStream_SingleBlockRead(object sender, SingleBlockReadEventArgs e)
        {
            _left = Math.Max((int)(Math.Abs(e.Left) * 10000), _left);
            _right = Math.Max((int)(Math.Abs(e.Right) * 10000), _right);

            if (++_peakUpdateCounter >= _waveIn.WaveFormat.SampleRate / 20)
            {
                Invoke(new MethodInvoker(() =>
                {
                    var amplitude = Math.Sqrt(_left * _left + _right * _right);
                    if (minAmplitude > amplitude) minAmplitude = amplitude;
                    if (maxAmplitude < amplitude) maxAmplitude = amplitude;
                    sumAmplitude += amplitude;
                    points++;
                    var averageAmplitude = sumAmplitude / points;
                    var dynamicRange = Math.Log10(maxAmplitude / minAmplitude);
                    var parp = Math.Log10(maxAmplitude / averageAmplitude);
                    lblDynRangeValue.Text = "" + dynamicRange;
                    lblParpValue.Text = "" + parp;
                    peakLeft.Value = _left;
                    peakRight.Value = _right;
                    _peakUpdateCounter = _left = _right = 0;
                }));
            }
        }
Example #3
0
 void notificationSource_SingleBlockRead(object sender, SingleBlockReadEventArgs e)
 {
     if (_analyser != null)
         _analyser.Add(e.Left, e.Right);
 }