flutter_tts icon indicating copy to clipboard operation
flutter_tts copied to clipboard

Version 3.5.3 getEngines won't return complete list of available engines

Open chimura opened this issue 1 year ago • 5 comments

🐛 Bug Report

When using version 3.5.3, calling getEngines won't return all the available engines installed on device.

Expected behavior

FlutterTts getEngines method on version 3.5.1 returns all the available engines installed on my device:

[com.samsung.SMT, com.google.android.tts, com.acapelagroup.android.tts, com.cereproc.Gabriel, com.github.olga_yakovleva.rhvoice.android, com.redzoc.ramees.tts.espeak]

But if I upgrade to version 3.5.3, it returns only:

[com.samsung.SMT, com.google.android.tts]

Same issue was observed across three different samsung devices (Galaxy s21, a7 5g and Galaxy tab a7 lite).

Same issue was observed using a stripped-down project that only instantiates FlutterTts and lists engines.

Tried version 3.5.2, but my project couldn't compile declaring this version as dependency.

Reproduction steps

Calling getEngines after instantiating FlutterTts.

Configuration

Version: 3.5.3

Platform:

  • [ ] :iphone: iOS
  • [x] :robot: Android

chimura avatar Oct 08 '22 15:10 chimura

@chimura can you confirm if this is still an issue with the latest version? The only difference in the android code is a conversion to Kotlin.

dlutton avatar Nov 06 '22 06:11 dlutton

Same issue with me. Confirm in OPPO and HUAWEI phones. OPPO has two engines but gets nothing. HUAWEI has four engines but gets only one.

joyjiyuan avatar Nov 18 '22 10:11 joyjiyuan

@joyjiyuan @chimura are you waiting for TTS to be initialized before you call the getEngines method? I added an initHandler for Android so you could do something like this:

flutterTts.setInitHandler(() {
    await flutterTts.getEngines;
});

of course you'll want to save it to a value so you can print them out for testing.

dlutton avatar Nov 18 '22 17:11 dlutton

@joyjiyuan @chimura are you waiting for TTS to be initialized before you call the getEngines method? I added an initHandler for Android so you could do something like this:

flutterTts.setInitHandler(() {
    await flutterTts.getEngines;
});

of course you'll want to save it to a value so you can print them out for testing.

Yes. I had used the call back, but the results are same.

joyjiyuan avatar Nov 19 '22 10:11 joyjiyuan

@joyjiyuan @chimura can you confirm when you get a moment if this is still an issue? I tested on a pixel device and it's working.

dlutton avatar Mar 11 '23 22:03 dlutton