Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed May 28, 2017
1 parent 99781bb commit 371c0d0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions speech-recognition.ios.ts
Expand Up @@ -100,16 +100,17 @@ export class SpeechRecognition implements SpeechRecognitionApi {

stopListening(): Promise<any> {
return new Promise((resolve, reject) => {
if (this.audioEngine.running) {
this.audioEngine.stop();
this.recognitionRequest.endAudio();
// this.speechRecognizer.delegate = null;
this.speechRecognizer = null;
this.recognitionTask = null;
resolve();
} else {
if (!this.audioEngine.running) {
reject("Not running");
return;
}

this.audioEngine.stop();
this.recognitionRequest.endAudio();
// this.speechRecognizer.delegate = null;
this.speechRecognizer = null;
this.recognitionTask = null;
resolve();
});
}
}
Expand Down

0 comments on commit 371c0d0

Please sign in to comment.