/// <summary>Create new VoiceLevelDetectCalibrate instance</summary> /// <param name="samplingRate">Sampling rate of the audio signal (in Hz).</param> /// <param name="numChannels">Number of channels in the audio signal.</param> public VoiceLevelDetectCalibrate(int samplingRate, int channels) { var x = new T[1]; if (x[0] is float) { LevelMeter = new LevelMeterFloat(samplingRate, channels); VoiceDetector = new VoiceDetectorFloat(samplingRate, channels); } else if (x[0] is short) { LevelMeter = new LevelMeterShort(samplingRate, channels); VoiceDetector = new VoiceDetectorShort(samplingRate, channels); } else { throw new Exception("VoiceLevelDetectCalibrate: type not supported: " + x[0].GetType()); } calibration = new VoiceDetectorCalibration <T>(VoiceDetector, LevelMeter, samplingRate, channels); }