selectSSVoice
Selects a speech-synthesis voice using explicit voice attributes and fallback matching rules.
Declaration
public func selectSSVoice(
_ ssVoiceParams: STSSVoiceParams,
ssEngine: String? = nil
) -> STResultOverview
Selects a speech-synthesis voice from the voices installed and available to the system. If selection fails or a desired voice does not appear in getSSVoices, first install it on the device. On supported iOS versions, look under Settings → Accessibility → Read & Speak → Voices → English → the desired voice (for example Ava (Premium)), then download it. Apple may change these Settings paths between OS versions.
Voice matching priority
The current API defines this selection order:
- identifier
- name
- gender + language + quality
- gender + language, choosing highest quality
- gender + quality, using US English
- language + quality, preferring female then male
- gender, choosing highest quality in US English
- language, preferring female then male and highest quality
- quality, using US English and preferring female then male
This lets an application be very specific when it knows an exact installed voice while still supporting portable criteria such as language, gender, and quality.
Return value
Returns .audioPlayerNotInitialized when the player is unavailable. Otherwise returns the selection result.