dlutton / flutter_tts

Flutter Text to Speech package
MIT License
610 stars 258 forks source link

iPhone 14 Pro Max (17.5.1) not work #520

Open giantss opened 2 months ago

giantss commented 2 months ago

🐛 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:

TheCodeDaniel commented 2 months ago

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 🙂 ?