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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software