SpeechTilesAndamento Docs
Get started
SDK Reference · Method

selectSSVoice

Selects a speech-synthesis voice using explicit voice attributes and fallback matching rules.

Declaration

public func selectSSVoice(
    _ ssVoiceParams: STSSVoiceParams,
    ssEngine: String? = nil
) -> STResult

Overview

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:

  1. identifier
  2. name
  3. gender + language + quality
  4. gender + language, choosing highest quality
  5. gender + quality, using US English
  6. language + quality, preferring female then male
  7. gender, choosing highest quality in US English
  8. language, preferring female then male and highest quality
  9. 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.

See Also