flutter_tts
flutter_tts copied to clipboard
No Sound on iOS
🐛 Bug Report
No build or runtime errors. The volume is turned up on my simulator and computer. There is simply no sound. My app is as simple as can be.
Expected behavior
That there is sound.
Reproduction steps
- Clone my repo.
- Run the app on an iOS simulator.
- Type any word or phrase into the input field.
- Press "Start Text To Speech".
- Listen to silence.
Configuration
Version: ^3.8.5
Platform:
- [x] :iphone: iOS
Running the simulator on MacOS M1.
me too
#311 Solved it for me (iPhone SE)
Is 3.8.5 not even a valid version then? We always have to downgrade?
Try the below code:
Try the below code:
![]()
Thanks for the suggestion. Unfortunately, the issue still persists.
To be clear, I can't get any sound to play in Google Chrome either. I'm not deploying to Chrome, so I don't mind that. The solution might very well not be iOS-specific though.
@12yanogden Did you find a work around for the iOS simulator issue?
@12yanogden Did you find a work around for the iOS simulator issue?
Nope. When I revisit my project, I'm probably going to choose another tts package. This one is simply broken, even for the most basic use case.
@rennylangat I apologize as I have been extremely busy, but will look into some of these issues in the next couple of days. Is this only occurring in your simulator or on an actual device?
@dlutton It happens on both.
On a physical device I get this Unable to list voice folder
error message upon running. Could be an issue with AV Speech Synthesizer?
Adding this after initialisation fixed it for me:
let flutterTts = FlutterTts(); await flutterTts.setSharedInstance(true); await flutterTts.setIosAudioCategory(IosTextToSpeechAudioCategory.playback, [ IosTextToSpeechAudioCategoryOptions.allowBluetooth, IosTextToSpeechAudioCategoryOptions.allowBluetoothA2DP, IosTextToSpeechAudioCategoryOptions.mixWithOthers, IosTextToSpeechAudioCategoryOptions.defaultToSpeaker ], IosTextToSpeechAudioMode.defaultMode );
I also encountered a situation where there was no sound, but in my case it was because I set it to silent mode (Silent switch).
I used IosTextToSpeechAudioCategory.playback
to be able to play sound even in silent mode.