Configure iOS for flutter_tts
masterWhen using flutter_tts on iOS, you can manage the audio session to control how your app's speech interacts with other audio (like background music).
Use setIosAudioCategory to set the category, options, and mode. For example, to allow background music and in-app audio to play simultaneously, use IosTextToSpeechAudioCategory.ambient with IosTextToSpeechAudioCategoryOptions.mixWithOthers.
await flutterTts.setIosAudioCategory(
IosTextToSpeechAudioCategory.ambient,
[
IosTextToSpeechAudioCategoryOptions.allowBluetooth,
IosTextToSpeechAudioCategoryOptions.allowBluetoothA2DP,
IosTextToSpeechAudioCategoryOptions.mixWithOthers
],
IosTextToSpeechAudioMode.voicePrompt
);