public LoopbackRecognizer(string key, string region) { this.capture = new WasapiLoopbackCapture(); this.stream = new WaveCaptureStream(this.capture); this.recognizer = new AzureSpeechRecognizer(key, region, this.stream); this.recognizer.SpeechPredicted += (snd, evt) => this.SpeechPredicted?.Invoke(snd, evt); this.recognizer.SpeechRecognized += (snd, evt) => this.SpeechRecognized?.Invoke(snd, evt); }
public LoopbackRecognizer() { this.capture = new WasapiLoopbackCapture(); this.stream = new WaveCaptureStream(this.capture); this.recognizer = new LocalSpeechRecognizer(this.stream); this.recognizer.SpeechPredicted += (snd, evt) => this.SpeechPredicted?.Invoke(snd, evt); this.recognizer.SpeechRecognized += (snd, evt) => this.SpeechRecognized?.Invoke(snd, evt); }