IoError = Tizen.Internals.Errors.ErrorCode.IoError, /* I/O error */
InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, /* Invalid parameter */
OutOfNetwork = Tizen.Internals.Errors.ErrorCode.Networkdown, /* Network is down */
- TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut, /* No answer from the STT service */
+ TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut, /* No answer from the TTS service */
PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, /* Permission denied */
- NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, /* STT NOT supported */
+ NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, /* TTS NOT supported */
InvalidState = ErrorTts | 0x01, /* Invalid state */
InvalidVoice = ErrorTts | 0x02, /* Invalid language */
EngineNotFound = ErrorTts | 0x03, /* No available engine */
[DllImport(Libraries.Tts, EntryPoint = "tts_pause", CallingConvention = CallingConvention.Cdecl)]
internal static extern TtsError TtsPause(IntPtr handle);
+ [DllImport(Libraries.Tts, EntryPoint = "tts_repeat", CallingConvention = CallingConvention.Cdecl)]
+ internal static extern TtsError TtsRepeat(IntPtr handle, out string text_repeat, out int utt_id);
+
[DllImport(Libraries.Tts, EntryPoint = "tts_set_state_changed_cb", CallingConvention = CallingConvention.Cdecl)]
internal static extern TtsError TtsSetStateChangedCB(IntPtr handle, TtsStateChangedCB callback, IntPtr userData);
/// <since_tizen> 3 </since_tizen>
InvalidParameter,
/// <summary>
- /// No answer from the STT service.
+ /// No answer from the TTS service.
/// </summary>
/// <since_tizen> 3 </since_tizen>
TimedOut,
/// <since_tizen> 3 </since_tizen>
PermissionDenied,
/// <summary>
- /// STT not supported.
+ /// TTS not supported.
/// </summary>
/// <since_tizen> 3 </since_tizen>
NotSupported,
/// Audio policy blocked.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- AudioPolicyBlocked
+ AudioPolicyBlocked,
+ /// <summary>
+ /// Not supported feature of current engine.
+ /// </summary>
+ /// <since_tizen> 10 </since_tizen>
+ NotSupportedFeature,
+ /// <summary>
+ /// Service reset.
+ /// </summary>
+ /// <since_tizen> 10 </since_tizen>
+ ServiceReset,
+ /// <summary>
+ /// Screen reader off.
+ /// </summary>
+ /// <since_tizen> 10 </since_tizen>
+ ScreenReaderOff
};
/// <summary>
/// The Default Voice SupportedVoice value, 0 if unable to get the value.
/// </returns>
/// <pre>
- /// The State should be ready.
+ /// The Client must be in the <see cref="State.Ready"/> state.
/// </pre>
public uint MaxTextSize
{
/// <exception cref="OutOfMemoryException">This exception can be due to out Of memory.</exception>
/// <exception cref="NotSupportedException">This exception can be due to TTS not supported.</exception>
/// <pre>
- /// The State should be created.
+ /// The Client must be in the <see cref="State.Created"/> state.
/// </pre>
public Mode CurrentMode
{
/// <exception cref="NotSupportedException">This exception can be due to TTS not supported.</exception>
/// <exception cref="ArgumentException">This exception can be due to improper value provided while setting the value.</exception>
/// <pre>
- /// The State should be created or ready.
+ /// The Client must be in the <see cref="State.Created"/> or <see cref="State.Ready"/> state.
/// </pre>
public void SetCredential(string credential)
{
/// <feature>
/// http://tizen.org/feature/speech.synthesis
/// </feature>
- /// <exception cref="InvalidOperationException">This exception can be due to an invalid state.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// This exception can be due to the following reasons while setting the value:
+ /// 1. Invalid state
+ /// 2. Screen reader off
+ /// </exception>
/// <exception cref="NotSupportedException">This exception can be due to TTS not supported.</exception>
/// <pre>
- /// The State must be Created.
+ /// The Client must be in the <see cref="State.Created"/> state.
/// </pre>
/// <post>
- /// If this function is successful, the TTS state will be ready.
+ /// If this function is successful, the Client will be in the <see cref="State.Ready"/> state.
/// If this function is unsuccessful, ErrorOccurred event will be invoked.
/// </post>
public void Prepare()
}
/// <summary>
- /// Disconnects from the STT service.
+ /// Disconnects from the TTS service.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <feature>
/// <exception cref="InvalidOperationException">This exception can be due to an invalid state.</exception>
/// <exception cref="NotSupportedException">This exception can be due to TTS not supported.</exception>
/// <pre>
- /// The state must be ready.
+ /// The Client must be in the <see cref="State.Ready"/> state.
/// </pre>
/// <post>
- /// If this function is successful, the TTS state will be created.
+ /// If this function is successful, the Client will be in the <see cref="State.Created"/> state.
/// </post>
public void Unprepare()
{
/// </exception>
/// <exception cref="NotSupportedException">This exception can be due to TTS not supported.</exception>
/// <pre>
- /// The state must be ready.
+ /// The Client must be in the <see cref="State.Ready"/> state.
/// </pre>
public string GetPrivateData(string key)
{
/// <exception cref="NotSupportedException">This exception can be due to TTS not supported.</exception>
/// <exception cref="ArgumentException">This exception can be due to improper value provided while setting the value.</exception>
/// <pre>
- /// The state must be ready.
+ /// The Client must be in the <see cref="State.Ready"/> state.
/// </pre>
public void SetPrivateData(string key, string data)
{
/// </exception>
/// <exception cref="NotSupportedException">This exception can be due to TTS not supported.</exception>
/// <pre>
- /// The state must be created.
+ /// The Client must be in the <see cref="State.Created"/> state.
/// </pre>
public SpeedRange GetSpeedRange()
{
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
- /// Locale MUST be set for UTF-8 text validation check.
+ /// Locale MUST be set for text validation check.
/// </remarks>
/// <param name="text">
- /// An input text based UTF-8.
+ /// An input text.
/// </param>
/// <param name="language">
/// The language selected from the SupportedVoice.Language Property obtained from GetSupportedVoices()(e.g. 'NULL'(Automatic),'en_US').
/// 1. Invalid State
/// 2. Operation Failure
/// 3. Invalid Voice
+ /// 4. Screen reader off
/// </exception>
/// <exception cref="NotSupportedException">This exception can be due to TTS not supported.</exception>
/// <exception cref="UnauthorizedAccessException">This exception can be due to permission denied.</exception>
/// <exception cref="ArgumentException">This exception can be due to improper value provided while setting the value.</exception>
/// <pre>
- /// The state must be ready or playing or paused.
+ /// The Client must be in the <see cref="State.Ready"/>, <see cref="State.Playing"/>, or <see cref="State.Paused"/> state.
/// </pre>
public int AddText(string text, string language, int voiceType, int speed)
{
/// 1. Invalid State
/// 2. Operation Failure
/// 3. Out of Network
+ /// 4. Screen reader off
/// </exception>
/// <exception cref="NotSupportedException">This exception can be due to TTS not supported.</exception>
/// <exception cref="UnauthorizedAccessException">This exception can be due to permission denied.</exception>
/// <pre>
- /// The state must be ready or paused.
+ /// The Client must be in the <see cref="State.Ready"/> or <see cref="State.Paused"/> state.
/// </pre>
/// <post>
- /// If this function succeeds, the TTS state will be playing.
+ /// If this function succeeds, the Client will be in the <see cref="State.Playing"/> state.
/// </post>
public void Play()
{
/// This exception can be due to the following reasons:
/// 1. Invalid Stat
/// 2. Operation Failure
+ /// 3. Screen reader off
/// </exception>
/// <exception cref="NotSupportedException">This exception can be due to TTS not supported.</exception>
/// <pre>
- /// The state must be ready or playing or paused.
+ /// The Client must be in the <see cref="State.Ready"/>, <see cref="State.Playing"/>, or <see cref="State.Paused"/> state.
/// </pre>
/// <post>
- /// If this function succeeds, the TTS state will be ready.
+ /// If this function succeeds, the Client will be in the <see cref="State.Ready"/> state.
/// This function will remove all text added via AddText() and synthesized sound data.
/// </post>
public void Stop()
/// This exception can be due to the following reasons:
/// 1. Invalid State
/// 2. Operation Failure
+ /// 3. Screen reader off
/// </exception>
/// <exception cref="NotSupportedException">This exception can be due to TTS not supported.</exception>
/// <pre>
- /// The state must be playing.
+ /// The Client must be in the <see cref="State.Playing"/> state.
/// </pre>
/// <post>
- /// If this function succeeds, the TTS state will be Paused.
+ /// If this function succeeds, the Client will be in the <see cref="State.Paused"/> state.
/// </post>
public void Pause()
{
}
/// <summary>
+ /// Repeats the last played text.
+ /// </summary>
+ /// <since_tizen> 10 </since_tizen>
+ /// <returns>
+ /// The RepeatedText value that stores the text to repeat and utterance ID.
+ /// </returns>
+ /// <feature>
+ /// http://tizen.org/feature/speech.synthesis
+ /// </feature>
+ /// <exception cref="InvalidOperationException">
+ /// This exception can be due to the following reasons:
+ /// 1. Invalid State
+ /// 2. Operation Failure
+ /// 3. Screen reader off
+ /// </exception>
+ /// <exception cref="NotSupportedException">This exception can be due to TTS not supported.</exception>
+ /// <pre>
+ /// The Client must be in the <see cref="State.Ready"/> state.
+ /// </pre>
+ /// <post>
+ /// If this function succeeds, the Client will be in the <see cref="State.Playing"/> state.
+ /// </post>
+ public RepeatedText Repeat()
+ {
+ TtsError error = TtsRepeat(_handle, out string text, out int uttId);
+ if (error != TtsError.None)
+ {
+ Log.Error(LogTag, "Repeat Failed with error " + error);
+ throw ExceptionFactory.CreateException(error);
+ }
+
+ return new RepeatedText(text, uttId);
+ }
+
+ /// <summary>
/// Method to release resources.
/// </summary>
/// <since_tizen> 3 </since_tizen>