Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

use 2 different SpeechRecognition in one class is not working !! #90

Open
itfuturz2020 opened this issue Mar 2, 2020 · 1 comment
Open

Comments

@itfuturz2020
Copy link

i am not able to use 2 different SpeechRecognition in one class. when i initialize both SpeechRecognition like -
_speechRecognition1= new SpeechRecognition();
_speechRecognition2 = new SpeechRecognition(); and when i set setRecognitionResultHandler to both variable , it is override _speechRecognition1 with _speechRecognition2 ...
why ?
if anyone understand my problem , then please give me solution !
thank you

@itfuturz2020 itfuturz2020 changed the title use 2 different SpeechRecognition variable is not working !! use 2 different SpeechRecognition in one class is not working !! Mar 2, 2020
@rodolZ80
Copy link

The SpeechRecognition is a Singleton

  static final SpeechRecognition _speech = new SpeechRecognition._internal();
  factory SpeechRecognition() => _speech;
  SpeechRecognition._internal() {
    _channel.setMethodCallHandler(_platformCallHandler);
  }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants