flutter_tts icon indicating copy to clipboard operation
flutter_tts copied to clipboard

No Sound on iOS

Open 12yanogden opened this issue 1 year ago • 11 comments

🐛 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

  1. Clone my repo.
  2. Run the app on an iOS simulator.
  3. Type any word or phrase into the input field.
  4. Press "Start Text To Speech".
  5. Listen to silence.

Configuration

Version: ^3.8.5

Platform:

  • [x] :iphone: iOS

Running the simulator on MacOS M1.

12yanogden avatar Jan 27 '24 03:01 12yanogden

me too

knight0zh avatar Jan 29 '24 07:01 knight0zh

#311 Solved it for me (iPhone SE)

yishaiSilver avatar Feb 02 '24 07:02 yishaiSilver

Is 3.8.5 not even a valid version then? We always have to downgrade?

12yanogden avatar Feb 02 '24 11:02 12yanogden

Try the below code:

image

TranTuanManh avatar Feb 02 '24 13:02 TranTuanManh

Try the below code:

image

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 avatar Feb 17 '24 17:02 12yanogden

@12yanogden Did you find a work around for the iOS simulator issue?

rennylangat avatar Mar 06 '24 17:03 rennylangat

@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.

12yanogden avatar Mar 06 '24 17:03 12yanogden

@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 avatar Mar 07 '24 08:03 dlutton

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

rennylangat avatar Mar 07 '24 10:03 rennylangat

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 );

mijiga avatar Apr 09 '24 20:04 mijiga

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.

hvlamdev avatar Apr 10 '24 11:04 hvlamdev