flutter_tts
flutter_tts copied to clipboard
I'm not able to trigger the setProgressHandler()
Great work on the plugin! I'm a little lost as to how to trigger the setProgressHandler though. Any help or information would be appreciated.
On my setup I'm using a shared flutter_tts Provider so that I only have 1 set of speech being triggered at a time. I've created functions in my Provider class to handle speech as follows~
` Future
flutterTts = FlutterTts();
flutterTts.setCompletionHandler(() {
setStop();
completionHandler();
});
flutterTts.setProgressHandler((String words, int start, int end, String word) {
progressHandler(words, start, end, word);
});
flutterTts.setErrorHandler((msg) {
setStop();
print("TTS Error!");
print(msg);
});
await flutterTts.setVolume(volume);
await flutterTts.setPitch(pitch);
await flutterTts.setSpeechRate(rate);
setStart();
await flutterTts.speak(vocab);
}`
On my widgets I call this function through ~
await Provider.of<TTSProvider>(context, listen: false).prgSpeak(vocab: targetLanguage progressHandler: (String words, int start, int end, String word) { print("Progress Handler triggered"); print('PROGRESS: $word => $start - $end'); });
@joervargas did you find the way? I have the same problem..
Same issue on EMUI10(huawei) devices!
I found the reason, only sdk version below 26 can get progressHandler working
same issue on Oneplus 8t (Colos OS 13 /Android 13). onProgress will not triggered when speak.
@fan123199 @Ricardoi1 sorry I've been extremely busy, but I'll try to carve out some time soon to fix this. Thanks for pointing out the issue @Ricardoi1 .
Hello, I have found progress issues on both Android 9 and Win11 devices. I hope you can handle them as soon as possible. Thank you