IosTextToSpeechAudioCategoryOptions enum

Inheritance

Values

mixWithOthers → const IosTextToSpeechAudioCategoryOptions

An option that indicates whether audio from this session mixes with audio from active sessions in other audio apps.

You can set this option explicitly only if the audio session category is IosTextToSpeechAudioCategory.playAndRecord or IosTextToSpeechAudioCategory.playback. If you set the audio session category to IosTextToSpeechAudioCategory.ambient, the session automatically sets this option. Likewise, setting the duckOthers or interruptSpokenAudioAndMixWithOthers options also enables this option.

If you set this option, your app mixes its audio with audio playing in background apps, such as the Music app.

duckOthers → const IosTextToSpeechAudioCategoryOptions

An option that reduces the volume of other audio sessions while audio from this session plays.

You can set this option only if the audio session category is IosTextToSpeechAudioCategory.playAndRecord or IosTextToSpeechAudioCategory.playback. Setting it implicitly sets the mixWithOthers option.

Use this option to mix your app’s audio with that of others. While your app plays its audio, the system reduces the volume of other audio sessions to make yours more prominent. If your app provides occasional spoken audio, such as in a turn-by-turn navigation app or an exercise app, you should also set the interruptSpokenAudioAndMixWithOthers option.

Note that ducking begins when you activate your app’s audio session and ends when you deactivate the session.

See also:

interruptSpokenAudioAndMixWithOthers → const IosTextToSpeechAudioCategoryOptions

An option that determines whether to pause spoken audio content from other sessions when your app plays its audio.

You can set this option only if the audio session category is IosTextToSpeechAudioCategory.playAndRecord or IosTextToSpeechAudioCategory.playback. Setting this option also sets mixWithOthers.

If you set this option, the system mixes your audio with other audio sessions, but interrupts (and stops) audio sessions that use the IosTextToSpeechAudioMode.spokenAudio audio session mode. It pauses the audio from other apps as long as your session is active. After your audio session deactivates, the system resumes the interrupted app’s audio.

Set this option if your app’s audio is occasional and spoken, such as in a turn-by-turn navigation app or an exercise app. This avoids intelligibility problems when two spoken audio apps mix. If you set this option, also set the duckOthers option unless you have a specific reason not to. Ducking other audio, rather than interrupting it, is appropriate when the other audio isn’t spoken audio.

allowBluetooth → const IosTextToSpeechAudioCategoryOptions

An option that determines whether Bluetooth hands-free devices appear as available input routes.

You can set this option only if the audio session category is IosTextToSpeechAudioCategory.playAndRecord or IosTextToSpeechAudioCategory.playback.

You’re required to set this option to allow routing audio input and output to a paired Bluetooth Hands-Free Profile (HFP) device. If you clear this option, paired Bluetooth HFP devices don’t show up as available audio input routes.

allowBluetoothA2DP → const IosTextToSpeechAudioCategoryOptions

An option that determines whether you can stream audio from this session to Bluetooth devices that support the Advanced Audio Distribution Profile (A2DP).

A2DP is a stereo, output-only profile intended for higher bandwidth audio use cases, such as music playback. The system automatically routes to A2DP ports if you configure an app’s audio session to use the IosTextToSpeechAudioCategory.ambient, IosTextToSpeechAudioCategory.ambientSolo, or IosTextToSpeechAudioCategory.playback categories.

Starting with iOS 10.0, apps using the IosTextToSpeechAudioCategory.playAndRecord category may also allow routing output to paired Bluetooth A2DP devices. To enable this behavior, pass this category option when setting your audio session’s category.

Note: If this option and the allowBluetooth option are both set, when a single device supports both the Hands-Free Profile (HFP) and A2DP, the system gives hands-free ports a higher priority for routing.

allowAirPlay → const IosTextToSpeechAudioCategoryOptions

An option that determines whether you can stream audio from this session to AirPlay devices.

Setting this option enables the audio session to route audio output to AirPlay devices. You can only explicitly set this option if the audio session’s category is set to IosTextToSpeechAudioCategory.playAndRecord. For most other audio session categories, the system sets this option implicitly.

defaultToSpeaker → const IosTextToSpeechAudioCategoryOptions

An option that determines whether audio from the session defaults to the built-in speaker instead of the receiver.

You can set this option only when using the IosTextToSpeechAudioCategory.playAndRecord category. It’s used to modify the category’s routing behavior so that audio is always routed to the speaker rather than the receiver if no other accessories, such as headphones, are in use.

When using this option, the system honors user gestures. For example, plugging in a headset causes the route to change to headset mic/headphones, and unplugging the headset causes the route to change to built-in mic/speaker (as opposed to built-in mic/receiver) when you’ve set this override.

In the case of using a USB input-only accessory, audio input comes from the accessory, and the system routes audio to the headphones, if attached, or to the speaker if the headphones aren’t plugged in. The use case is to route audio to the speaker instead of the receiver in cases where the audio would normally go to the receiver.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<IosTextToSpeechAudioCategoryOptions>
A constant List of the values in this enum, in order of their declaration.