I'm using the plugin flutter_tts.
await flutterTts.setIosAudioCategory(IosTextToSpeechAudioCategory.playback,
[
//I've tried all of these options
IosTextToSpeechAudioCategoryOptions.mixWithOthers,
IosTextToSpeechAudioCategoryOptions.duckOthers,
IosTextToSpeechAudioCategoryOptions.interruptSpokenAudioAndMixWithOthers,
//the following are not relevant to my question I think
IosTextToSpeechAudioCategoryOptions.allowBluetooth,
IosTextToSpeechAudioCategoryOptions.allowBluetoothA2DP,
IosTextToSpeechAudioCategoryOptions.defaultToSpeaker
],
IosTextToSpeechAudioMode.defaultMode
);
The only result I get, is that audio from youtube for example (I have youtube premium, so I can play it in the background) pauses, and doesn't resume after my tts is done.
What I want, is that the volume of any background audio will only be reduced temporarily, while my tts plays, and later raised back again. I thought this one is supposed to do that, but it doesn't work, it completely pauses the background audio and doesn't resume it:
enum IosTextToSpeechAudioCategoryOptions {
...
/// An option that reduces the volume of other audio session while audio
/// from this session plays.
duckOthers,
...
}