[ACR-1216][tts][Add tts_repeat()]
[platform/core/uifw/tts.git] / include / tts_internal.h
index 434b8da..88babea 100644 (file)
@@ -28,6 +28,11 @@ extern "C"
 #endif
 
 /**
+ * @brief Definition for TTS interrupt mode
+ */
+#define TTS_MODE_INTERRUPT             3
+
+/**
  * @brief Sets server tts.
  * @details Using this API, the application can ask server tts with a credential.
  *  The credential is a key to verify the authorization about using the engine based on server, not embeded engine.
@@ -53,13 +58,93 @@ extern "C"
 */
 int tts_set_server_tts(tts_h tts, const char* credential);
 
+/**
+ * @brief Adds a sound stream to the queue.
+ * @since_tizen 4.0
+ *
+ * @param[in] tts The TTS handle
+ * @param[in] event An event about pcm buffer (-1: error, 1: start, 2: continue, 3: finish) 
+ * @param[in] data The pcm data buffer
+ * @param[in] data_size The data size of pcm data buffer
+ * @param[in] audio_type The audio type of pcm (0: signed 16-bit, 1: unsigned 8-bit)
+ * @param[in] rate The sampling rate of pcm
+ * @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_OPERATION_FAILED Operation failure
+ * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
+ * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
+ * @pre The state should be #TTS_STATE_READY, #TTS_STATE_PLAYING, or #TTS_STATE_PAUSED.
+ * @see tts_play_pcm()
+ * @see tts_stop_pcm()
+*/
+int tts_add_pcm(tts_h tts, int event, const void* data, unsigned int data_size, int audio_type, int rate);
+
+/**
+ * @brief Request to play pcm.
+ * @since_tizen 4.0
+ *
+ * @param[in] tts The TTS handle
+ * @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_OPERATION_FAILED Operation failure
+ * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
+ * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
+ * @pre The state should be #TTS_STATE_READY or #TTS_STATE_PAUSED.
+ * @see tts_add_pcm()
+ * @see tts_stop_pcm()
+*/
+int tts_play_pcm(tts_h tts);
+
+/**
+ * @brief Request to stop pcm.
+ * @since_tizen 4.0
+ *
+ * @param[in] tts The TTS handle
+ * @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_OPERATION_FAILED Operation failure
+ * @retval #TTS_ERROR_NOT_SUPPORTED TTS NOT supported
+ * @retval #TTS_ERROR_PERMISSION_DENIED Permission denied
+ * @pre The state should be #TTS_STATE_READY, #TTS_STATE_PLAYING, or #TTS_STATE_PAUSED.
+ * @see tts_play_pcm()
+ * @see tts_add_pcm()
+*/
+int tts_stop_pcm(tts_h tts);
+
+
+/**
+ * @brief Connects the daemon asynchronously.
+ * @since_tizen 5.0
+ * @param[in] tts The TTS handle
+ * @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
+ * @pre The state should be #TTS_STATE_CREATED.
+ * @post If this function is successful, the TTS state will be #TTS_STATE_READY.
+ *       If this function is failed, the error callback is called. (e.g. #TTS_ERROR_ENGINE_NOT_FOUND)
+ * @see tts_unprepare()
+*/
+int tts_prepare_sync(tts_h tts);
+
 
 #ifdef __cplusplus
 }
 #endif
 
 /**
  * @}@}
   */
@}
+ */
 
 #endif /* __TTS_INTERNAL_H__ */