Add internal method to play pcm data
[platform/core/uifw/tts.git] / include / tts_internal.h
index 434b8da..1c02cb5 100644 (file)
@@ -53,6 +53,67 @@ 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_PLAYING.
+ * @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.
+ * @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_PLAYING.
+ * @see tts_play_pcm()
+ * @see tts_add_pcm()
+*/
+int tts_stop_pcm(tts_h tts);
 
 #ifdef __cplusplus
 }