/// <summary>Start calibration.</summary> /// <param name="durationMs">Duration of the calibration procedure (in milliseconds).</param> /// This activates the Calibration process. /// It will reset the given LevelMeter's AccumAvgPeakAmp (accumulated average peak amplitude), /// and when the duration has passed, use it for the VoiceDetector's detection threshold. public void Calibrate(int durationMs, Action <float> onCalibrated = null) { this.calibrateCount = valuesPerSec * durationMs / 1000; this.onCalibrated = onCalibrated; levelMeter.ResetAccumAvgPeakAmp(); }
public void VoiceDetectorCalibrate(int durationMs) { this.voiceDetectorCalibrateCount = samplesPerSec * durationMs / 1000; levelMeter.ResetAccumAvgPeakAmp(); }
/// <summary>Start calibration.</summary> /// <param name="durationMs">Duration of the calibration procedure (in milliseconds).</param> /// This activates the Calibration process. /// It will reset the given LevelMeter's AccumAvgPeakAmp (accumulated average peak amplitude), /// and when the duration has passed, use it for the VoiceDetector's detection threshold. public void Calibrate(int durationMs) { this.calibrateCount = valuesPerSec * durationMs / 1000; levelMeter.ResetAccumAvgPeakAmp(); }