Ejemplo n.º 1
0
            /// <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);
            }
Ejemplo n.º 2
0
 public VoiceDetectorCalibration(IVoiceDetector voiceDetector, ILevelMeter levelMeter, int samplesPerSec)
 {
     this.samplesPerSec = samplesPerSec;
     this.voiceDetector = voiceDetector;
     this.levelMeter    = levelMeter;
 }
Ejemplo n.º 3
0
 /// <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;
 }
Ejemplo n.º 4
0
            }                                                // Dummy constructor

            public VoiceDetectorCalibration(IVoiceDetector voiceDetector, ILevelMeter levelMeter, int samplingRate, int channels)
            {
            }