flutter_tts
flutter_tts copied to clipboard
setProgressHandler is not work
🐛 Bug Report
Expected behavior
setProgressHandler can work
Reproduction steps
l set this
flutterTts.setProgressHandler((String text, int startOffset, int endOffset, String word) {
print("cccc");
print('$startOffset, $endOffset, $word');
});
but not work, the callback is not call
l find source code in android file has
if (Build.VERSION.SDK_INT < 26) {
onProgress(utteranceId, 0, utterances[utteranceId]!!.length)
}
why need this judge and what should l do, progress change can notify
Configuration
Version: 4.2.2
Platform: Android11
I found that the problem is not a bug in the code. Huawei, Xiaomi and other phones do not support triggering the onRangeStart method, which results in the inability to trigger the onProgress function