flutter_tts icon indicating copy to clipboard operation
flutter_tts copied to clipboard

iPhone 14 Pro Max (17.5.1) not work

Open giantss opened this issue 1 year ago • 1 comments

🐛 Bug Report

I received user feedback that there is no sound when playing speech synthesis on iPhone 14 Pro Max (17.5.1) (the code is executed and no errors are seen). I tried two other iPhone 15 pro (17.4.1) and iPhone 12 (17.2.1), and they can play normally. I suspect that the system version is too high. Then I upgraded the iPhone 15 pro system version to 17.6.1, and the test playback can still play. What should I do if I encounter such a problem?

Configuration

Flutter 3.19.5 flutter_tts: ^3.8.5

Platform:

  • [ ] :iphone: iOS image

giantss avatar Aug 13 '24 11:08 giantss

I think you should try

  1. Upgrade to the current latest version I also use IOS "17.5.1", although i don't use iPhone 14 series, but it works fine for me.
  2. Also check your code implementation.

`
FlutterTts flutterTts = FlutterTts();

Future initializeTts() async { await flutterTts.setLanguage("en-US"); // Set the language await flutterTts.setPitch(1.0); // Set the pitch }

speak(String text) async { var result = await flutterTts.speak(text); if (kDebugMode) { print("Speaking started: ${result == 1 ? true : false}"); } }

stopSpeaking() async { var result = await flutterTts.stop(); if (kDebugMode) { print("Speaking started: ${result == 1 ? true : false}"); } }

@override void initState() { super.initState(); initializeTts(); }

@override void dispose() { flutterTts.stop(); super.dispose(); }`

That is the code i used and it worked for me.

@dlutton , i think this should work, it could lead to one less issue on this repo 🙂 ?

TheCodeDaniel avatar Aug 25 '24 05:08 TheCodeDaniel