[ACR-1216][tts][Add tts_repeat()]
[platform/core/uifw/tts.git] / include / tts.h
index 878ef1b..6de4882 100644 (file)
@@ -609,6 +609,30 @@ int tts_stop(tts_h tts);
 */
 int tts_pause(tts_h tts);
 
+/**
+ * @brief Repeats the last played text.
+ * @since_tizen 5.0
+ * @remarks This function repeats the last played text once. If there is no previous text, this function will not work.
+ *          If the language is changed, the last played text is removed.
+ *          Before calling this function, please call 'tts_stop()' in order to stop playing the previous one.
+ *          If this function succeeds, @a text_repeat must be released with free().
+ * @param[in] tts The TTS handle
+ * @param[out] text_repeat Texts to be played repeatedly
+ * @param[out] utt_id The utterance ID passed to the callback function
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #TTS_ERROR_NONE Successful
+ * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #TTS_ERROR_INVALID_STATE Invalid state
+ * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
+ * @retval #TTS_ERROR_OPERATION_FAILED Operation failure
+ * @pre The state should be #TTS_STATE_READY.
+ * @post If this function succeeds, the TTS state will be #TTS_STATE_PLAYING.
+ * @see tts_add_text()
+ * @see tts_stop()
+ */
+int tts_repeat(tts_h tts, char** text_repeat, int* utt_id);
 
 /**
  * @brief Registers a callback function to be called when the TTS state changes.