/// <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); }
public VoiceDetectorCalibration(IVoiceDetector voiceDetector, ILevelMeter levelMeter, int samplesPerSec) { this.samplesPerSec = samplesPerSec; this.voiceDetector = voiceDetector; this.levelMeter = levelMeter; }
/// <summary>Create new VoiceDetectorCalibration instance.</summary> /// <param name="voiceDetector">Voice Detector to calibrate.</param> /// <param name="levelMeter">Level Meter to look at for calibration.</param> /// <param name="samplingRate">Sampling rate of the audio signal (in Hz).</param> /// <param name="numChannels">Number of channels in the audio signal.</param> public VoiceDetectorCalibration(IVoiceDetector voiceDetector, ILevelMeter levelMeter, int samplingRate, int channels) { this.valuesPerSec = samplingRate * channels; this.voiceDetector = voiceDetector; this.levelMeter = levelMeter; }
} // Dummy constructor public VoiceDetectorCalibration(IVoiceDetector voiceDetector, ILevelMeter levelMeter, int samplingRate, int channels) { }