flutter_tts icon indicating copy to clipboard operation
flutter_tts copied to clipboard

setProgressHandler is not work

Open YYL1999 opened this issue 1 year ago • 1 comments

🐛 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

YYL1999 avatar Feb 12 '25 10:02 YYL1999

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

YYL1999 avatar Jun 05 '25 05:06 YYL1999