/// <summary> /// Initializes the service. /// Service can be used when the "Ready" property returns "true" value. /// </summary> public void Init() { if (Ready) { return; } if (_client.DefaultVoice.Language == DEFAULT_VOICE_LANGUAGE) { _currentVoice = _client.DefaultVoice; } else { _currentVoice = _client.GetSupportedVoices(). FirstOrDefault(voice => voice.Language == DEFAULT_VOICE_LANGUAGE) ?? _client.DefaultVoice; } _client.Prepare(); }
/// <summary> /// Called when the engine service user gets the whole supported voice list. /// </summary> /// <remarks> /// In this function, the engine service user's callback function 'SupportedVoice()' is invoked repeatedly for getting all the supported voices, /// and userData must be transferred to 'SupportedVoice()'. If 'SupportedVoice()' returns false, it should be stopped to call 'SupportedVoice()'.</remarks> /// <param name="callback">The callback function.</param> /// <param name="userData">The user data which must be passed to SupportedVoice().</param> /// <returns> /// The following error codes can be returned: /// 1. None /// 2. OperationFailed /// </returns> /// <postcondition>This callback function invokes SupportedVoice() repeatedly for getting all the supported voices.</postcondition> /// <since_tizen> 4 </since_tizen> public abstract Error ForEachSupportedVoices(SupportedVoice callback, IntPtr userData);