public void Start(DetectionAlgorithm algorithm) { if (algorithm == DetectionAlgorithm.AUTOCORRELATION) { ptracker = new PitchTracker(); ptracker.PitchDetected += ptracker_PitchDetected; ptracker.SampleRate = _microphone.SampleRate; } else if (algorithm == DetectionAlgorithm.YIN) { yin = new Yin(_microphone.SampleRate, _bufferSize / 4); } _microphone.Start(); }
public void Stop() { ptracker.PitchDetected-=ptracker_PitchDetected; yin = null; _microphone.Stop(); }
public void Start(DetectionAlgorithm algorithm) { if (algorithm == DetectionAlgorithm.AUTOCORRELATION) { ptracker = new PitchTracker(); ptracker.PitchDetected += ptracker_PitchDetected; ptracker.SampleRate = _microphone.SampleRate; } else if (algorithm == DetectionAlgorithm.YIN) { yin = new Yin(_microphone.SampleRate, _bufferSize/4); } _microphone.Start(); }
public void Stop() { ptracker.PitchDetected -= ptracker_PitchDetected; yin = null; _microphone.Stop(); }