OSSVoice
@available(iOS 9.0, *)
public class OSSVoice : AVSpeechSynthesisVoice
OSSVoice overides some of the properties provided to enable setting as well as getting.
The purpose of this class is so that a single voice object can be set and reused through the Speech instance. Properties have been overriden for this very purpose.
Setting the voice quality to be .enhanced
instead of .default
and the resetting of language after creation is not enabled in the AV provided API instance of AVSpeechSynthesisVoice.
Note
If init() is called, the default quality of OSSVoice will us “default” and the language will be “OSSVoiceEnum.UnitedStatesEnglish”.-
You have access to set the voice quality or use the default which is set to .default
Declaration
Swift
override public var quality: AVSpeechSynthesisVoiceQuality { get set }
-
Language offers a get and set. The default value is United States English.
Declaration
Swift
override public var language: String { get set }
-
Returns the current voice type enum to allow for obtining details.
Declaration
Swift
public var voiceType: OSSVoiceEnum { get }
-
If this init is used, defaults will be used.
This method will set default values on the language and quality of voice.
Langague defaults to United States English.
Quality defaults to .default.
Declaration
Swift
public override init()
-
This init method is required as it sets the voice quality and language in order to speak the text passed in.
Declaration
Swift
public init?(quality: AVSpeechSynthesisVoiceQuality, language: OSSVoiceEnum)
-
Required: Do not recommend using.
Declaration
Swift
public required init?(coder aDecoder: NSCoder)