Initializer

init(language:)

Returns a voice object for the specified language and locale.

Declaration

init?(language languageCode: String?)

Parameters

language

A BCP 47 code specifying language and locale for a voice.

Return Value

An AVSpeechSynthesisVoice object for the specified language and locale.

Discussion

Returns nil if the language parameter is nil or references a language or locale for which no voice exists.

See Also

Finding Voices

init?(identifier: String)

Returns a voice object for the specified identifier.

let AVSpeechSynthesisVoiceIdentifierAlex: String

The voice object identified as Alex.