return TTS_ERROR_NONE;
}
+int tts_set_credential(tts_h tts, const char* credential)
+{
+ if(0 != __tts_get_feature_enabled()) {
+ return TTS_ERROR_NOT_SUPPORTED;
+ }
+
+ if (NULL == tts || NULL == credential) {
+ SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Input parameter is null");
+ return TTS_ERROR_INVALID_PARAMETER;
+ }
+
+ tts_client_s* client = tts_client_get(tts);
+
+ if (NULL == client) {
+ SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Get state : A handle is not valid");
+ return TTS_ERROR_INVALID_PARAMETER;
+ }
+
+ if (TTS_STATE_CREATED != client->current_state && TTS_STATE_READY != client->current_state) {
+ SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] The current state is invalid (%d).", client->current_state);
+ return TTS_ERROR_INVALID_STATE;
+ }
+
+ client->credential = strdup(credential);
+
+ SLOG(LOG_DEBUG, TAG_TTSC, "=====");
+ SLOG(LOG_DEBUG, TAG_TTSC, " ");
+
+ return TTS_ERROR_NONE;
+}
+
static Eina_Bool __tts_connect_daemon(void *data)
{
tts_h tts = (tts_h)data;
/* do request initialize */
int ret = -1;
- ret = tts_dbus_request_initialize(client->uid);
+ bool credential_needed = false;
+
+ ret = tts_dbus_request_initialize(client->uid, &credential_needed);
if (TTS_ERROR_ENGINE_NOT_FOUND == ret) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to initialize : %s", __tts_get_error_code(ret));
} else {
/* success to connect tts-daemon */
+ client->credential_needed = credential_needed;
+ SLOG(LOG_ERROR, TAG_TTSC, "Supported options : credential(%s)", credential_needed ? "need" : "no need");
}
client->conn_timer = NULL;
return TTS_ERROR_INVALID_STATE;
}
+ if (true == client->credential_needed && NULL == client->credential) {
+ SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Do not have app credential for this engine");
+ return TTS_ERROR_PERMISSION_DENIED;
+ }
+
/* check valid utf8 */
iconv_t *ict;
ict = iconv_open("utf-8", "");
int ret = -1;
int count = 0;
while (0 != ret) {
- ret = tts_dbus_request_add_text(client->uid, out_buf, temp, voice_type, speed, client->current_utt_id);
+ ret = tts_dbus_request_add_text(client->uid, out_buf, temp, voice_type, speed, client->current_utt_id, client->credential);
if (0 != ret) {
if (TTS_ERROR_TIMED_OUT != ret) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] result : %s", __tts_get_error_code(ret));
int ret = -1;
int count = 0;
while (0 != ret) {
- ret = tts_dbus_request_play(client->uid);
+ ret = tts_dbus_request_play(client->uid, client->credential);
if (0 != ret) {
if (TTS_ERROR_TIMED_OUT != ret) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] result : %s", __tts_get_error_code(ret));
return TTS_ERROR_INVALID_STATE;
}
+ if (true == client->credential_needed && NULL == client->credential) {
+ SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Do not have app credential for this engine");
+ return TTS_ERROR_PERMISSION_DENIED;
+ }
+
ecore_main_loop_thread_safe_call_async(__tts_play_async, (void*)tts);
SLOG(LOG_DEBUG, TAG_TTSC, "=====");
return TTS_ERROR_INVALID_STATE;
}
+ if (true == client->credential_needed && NULL == client->credential) {
+ SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Do not have app credential for this engine");
+ return TTS_ERROR_PERMISSION_DENIED;
+ }
+
int ret = -1;
int count = 0;
while (0 != ret) {
- ret = tts_dbus_request_play(client->uid);
+ ret = tts_dbus_request_play(client->uid, client->credential);
if (0 != ret) {
if (TTS_ERROR_TIMED_OUT != ret) {
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] result : %s", __tts_get_error_code(ret));
/* connection */
Ecore_Timer* conn_timer;
+
+ /* options */
+ char* credential;
+ bool credential_needed;
} tts_client_s;
int tts_client_new(tts_h* tts);
return result;
}
-int tts_dbus_request_initialize(int uid)
+int tts_dbus_request_initialize(int uid, bool* credential_needed)
{
DBusMessage* msg;
DBusError err;
dbus_error_free(&err);
}
+ int temp = 0;
if (NULL != result_msg) {
dbus_message_get_args(result_msg, &err,
DBUS_TYPE_INT32, &result,
+ DBUS_TYPE_INT32, &temp,
DBUS_TYPE_INVALID);
if (dbus_error_is_set(&err)) {
dbus_message_unref(result_msg);
if (0 == result) {
- SLOG(LOG_DEBUG, TAG_TTSC, "<<<< tts initialize : result = %d", result);
+ *credential_needed = (bool)temp;
+ SLOG(LOG_DEBUG, TAG_TTSC, "<<<< tts initialize : result = %d, credential_needed(%d)", result, *credential_needed);
} else {
SLOG(LOG_ERROR, TAG_TTSC, "<<<< tts initialize : result = %d", result);
}
return result;
}
-int tts_dbus_request_add_text(int uid, const char* text, const char* lang, int vctype, int speed, int uttid)
+int tts_dbus_request_add_text(int uid, const char* text, const char* lang, int vctype, int speed, int uttid, const char* credential)
{
if (NULL == text || NULL == lang) {
SLOG(LOG_ERROR, TAG_TTSC, "Input parameter is NULL");
SLOG(LOG_ERROR, TAG_TTSC, ">>>> Request tts add text : Fail to make message");
return TTS_ERROR_OPERATION_FAILED;
} else {
- SLOG(LOG_DEBUG, TAG_TTSC, ">>>> Request tts add text : uid(%d), text(%s), lang(%s), type(%d), speed(%d), id(%d)",
- uid, text, lang, vctype, speed, uttid);
+ SLOG(LOG_DEBUG, TAG_TTSC, ">>>> Request tts add text : uid(%d), text(%s), lang(%s), type(%d), speed(%d), id(%d), credential(%s)",
+ uid, text, lang, vctype, speed, uttid, (NULL == credential) ? "NULL" : credential);
+ }
+
+ char *temp = NULL;
+ if (NULL == credential) {
+ temp = strdup("NULL");
+ } else {
+ temp = strdup(credential);
}
if (true != dbus_message_append_args(msg,
DBUS_TYPE_INT32, &vctype,
DBUS_TYPE_INT32, &speed,
DBUS_TYPE_INT32, &uttid,
+ DBUS_TYPE_STRING, &temp,
DBUS_TYPE_INVALID)) {
dbus_message_unref(msg);
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to append args");
+ if (NULL != temp) {
+ free(temp);
+ temp = NULL;
+ }
return TTS_ERROR_OPERATION_FAILED;
}
result = TTS_ERROR_TIMED_OUT;
}
+ if (NULL != temp) {
+ free(temp);
+ temp = NULL;
+ }
return result;
}
return result;
}
-int tts_dbus_request_play(int uid)
+int tts_dbus_request_play(int uid, const char* credential)
{
DBusMessage* msg;
DBusError err;
SLOG(LOG_DEBUG, TAG_TTSC, ">>>> Request tts play : uid(%d)", uid);
}
- if (true != dbus_message_append_args(msg, DBUS_TYPE_INT32, &uid, DBUS_TYPE_INVALID)) {
+ char *temp = NULL;
+ if (NULL == credential) {
+ temp = strdup("NULL");
+ } else {
+ temp = strdup(credential);
+ }
+
+ if (true != dbus_message_append_args(msg,
+ DBUS_TYPE_INT32, &uid,
+ DBUS_TYPE_STRING, &temp,
+ DBUS_TYPE_INVALID)) {
dbus_message_unref(msg);
SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to append args");
+ if (NULL != temp) {
+ free(temp);
+ temp = NULL;
+ }
return TTS_ERROR_OPERATION_FAILED;
}
result = TTS_ERROR_TIMED_OUT;
}
+ if (NULL != temp) {
+ free(temp);
+ temp = NULL;
+ }
return result;
}
int tts_dbus_request_hello(int uid);
-int tts_dbus_request_initialize(int uid);
+int tts_dbus_request_initialize(int uid, bool* credential_needed);
int tts_dbus_request_finalize(int uid);
int tts_dbus_set_sound_type(int uid, int type);
-int tts_dbus_request_add_text(int uid, const char* text, const char* lang, int vctype, int speed, int uttid);
+int tts_dbus_request_add_text(int uid, const char* text, const char* lang, int vctype, int speed, int uttid, const char* credential);
-int tts_dbus_request_play(int uid) ;
+int tts_dbus_request_play(int uid, const char* credential);
int tts_dbus_request_stop(int uid);
int tts_get_mode(tts_h tts, tts_mode_e* mode);
/**
+ * @brief Sets the app credential.
+ * @since_tizen 3.0
+ * @privlevel public
+ *
+ * @param[in] tts The TTS handle
+ * @param[in] credential The app credential
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #TTS_ERROR_NONE Success
+ * @retval #TTS_ERROR_INVALID_STATE Invalid state
+ * @retval #TTS_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre The state should be #TTS_STATE_CREATED or #TTS_STATE_READY.
+ *
+ * @see tts_play()
+*/
+int tts_set_credential(tts_h tts, const char* credential);
+
+/**
* @brief Connects the daemon asynchronously.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @retval #TTS_ERROR_INVALID_VOICE Invalid voice about language, voice type
* @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_get_max_text_size()
+ * @see tts_set_credential()
*/
int tts_add_text(tts_h tts, const char* text, const char* language, int voice_type, int speed, int* utt_id);
* @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 current state should be #TTS_STATE_READY or #TTS_STATE_PAUSED.
* @post If this function succeeds, the TTS state will be #TTS_STATE_PLAYING.
* @see tts_utterance_started_cb()
* @see tts_utterance_completed_cb()
* @see tts_error_cb()
+ * @see tts_set_credential()
*/
int tts_play(tts_h tts);
dbus_error_init(&err);
int pid, uid;
+ bool credential_needed = 0;
int ret = 0;
dbus_message_get_args(msg, &err,
} else {
SECURE_SLOG(LOG_DEBUG, get_tag(), "[IN] tts initialize : pid(%d), uid(%d)", pid , uid);
- ret = ttsd_server_initialize(pid, uid);
+ ret = ttsd_server_initialize(pid, uid, &credential_needed);
}
DBusMessage* reply;
reply = dbus_message_new_method_return(msg);
+ int temp = (int)credential_needed;
+ SLOG(LOG_DEBUG, get_tag(), "[OUT] tts initialize : result(%d), credential_needed(%d)", ret, (int)credential_needed);
if (NULL != reply) {
- dbus_message_append_args(reply, DBUS_TYPE_INT32, &ret, DBUS_TYPE_INVALID);
+ dbus_message_append_args(reply,
+ DBUS_TYPE_INT32, &ret,
+ DBUS_TYPE_INT32, &temp,
+ DBUS_TYPE_INVALID);
if (0 == ret) {
- SLOG(LOG_DEBUG, get_tag(), "[OUT] tts initialize : result(%d)", ret);
+ SLOG(LOG_DEBUG, get_tag(), "[OUT] tts initialize : result(%d), credential_needed(%d)", ret, credential_needed);
} else {
SLOG(LOG_ERROR, get_tag(), "[OUT ERROR] tts initialize : result(%d)", ret);
}
dbus_error_init(&err);
int uid, voicetype, speed, uttid;
- char *text, *lang;
+ char *text, *lang, *credential;
int ret = 0;
dbus_message_get_args(msg, &err,
DBUS_TYPE_INT32, &voicetype,
DBUS_TYPE_INT32, &speed,
DBUS_TYPE_INT32, &uttid,
+ DBUS_TYPE_STRING, &credential,
DBUS_TYPE_INVALID);
SLOG(LOG_DEBUG, get_tag(), ">>>>> TTS ADD TEXT");
ret = TTSD_ERROR_OPERATION_FAILED;
} else {
- SECURE_SLOG(LOG_DEBUG, get_tag(), "[IN] tts add text : uid(%d), text(%s), lang(%s), type(%d), speed(%d), uttid(%d)",
- uid, text, lang, voicetype, speed, uttid);
- ret = ttsd_server_add_queue(uid, text, lang, voicetype, speed, uttid);
+ SECURE_SLOG(LOG_DEBUG, get_tag(), "[IN] tts add text : uid(%d), text(%s), lang(%s), type(%d), speed(%d), uttid(%d), credential(%s)",
+ uid, text, lang, voicetype, speed, uttid, credential);
+ ret = ttsd_server_add_queue(uid, text, lang, voicetype, speed, uttid, credential);
}
DBusMessage* reply;
dbus_error_init(&err);
int uid;
+ char* credential;
int ret = 0;
- dbus_message_get_args(msg, &err, DBUS_TYPE_INT32, &uid, DBUS_TYPE_INVALID);
+ dbus_message_get_args(msg, &err,
+ DBUS_TYPE_INT32, &uid,
+ DBUS_TYPE_STRING, &credential,
+ DBUS_TYPE_INVALID);
SLOG(LOG_DEBUG, get_tag(), ">>>>> TTS PLAY");
dbus_error_free(&err);
ret = TTSD_ERROR_OPERATION_FAILED;
} else {
- SECURE_SLOG(LOG_DEBUG, get_tag(), "[IN] tts play : uid(%d)", uid);
- ret = ttsd_server_play(uid);
+ SECURE_SLOG(LOG_DEBUG, get_tag(), "[IN] tts play : uid(%d), credential(%s)", uid, credential);
+ ret = ttsd_server_play(uid, credential);
}
DBusMessage* reply;
return 0;
}
+int ttsd_engine_agent_is_credential_needed(int uid, bool* credential_needed)
+{
+ if (NULL == credential_needed) {
+ SLOG(LOG_ERROR, get_tag(), "[Engine Agent ERROR] Invalid Parameter");
+ return TTSP_ERROR_INVALID_PARAMETER;
+ }
+
+ if (false == g_agent_init) {
+ SLOG(LOG_ERROR, get_tag(), "[Engine Agent ERROR] Not Initialized");
+ return TTSD_ERROR_OPERATION_FAILED;
+ }
+
+ if (false == g_cur_engine.is_loaded) {
+ SLOG(LOG_ERROR, get_tag(), "[Engine Agent ERROR] Not loaded engine");
+ return TTSD_ERROR_OPERATION_FAILED;
+ }
+
+ if (NULL == g_cur_engine.pefuncs->need_app_credential) {
+ SLOG(LOG_ERROR, get_tag(), "[Engine Agent ERROR] Not support to check app credential");
+ return TTSD_ERROR_OPERATION_FAILED;
+ }
+
+ bool result = false;
+ result = g_cur_engine.pefuncs->need_app_credential();
+ *credential_needed = result;
+
+ return TTSP_ERROR_NONE;
+}
+
/******************************************************************************************
* TTS Engine Interfaces for client
*******************************************************************************************/
return 0;
}
-int ttsd_engine_start_synthesis(const char* lang, int vctype, const char* text, int speed, void* user_param)
+int ttsd_engine_start_synthesis(const char* lang, int vctype, const char* text, int speed, const char* credential, void* user_param)
{
if (false == g_agent_init) {
SLOG(LOG_ERROR, get_tag(), "[Engine Agent ERROR] Not Initialized");
if (NULL != temp_lang) free(temp_lang);
return TTSD_ERROR_INVALID_VOICE;
} else {
- SECURE_SLOG(LOG_DEBUG, get_tag(), "[Engine Agent] Start synthesis : language(%s), type(%d), speed(%d), text(%s)",
- temp_lang, temp_type, speed, text);
+ SECURE_SLOG(LOG_DEBUG, get_tag(), "[Engine Agent] Start synthesis : language(%s), type(%d), speed(%d), text(%s), credential(%s)",
+ temp_lang, temp_type, speed, text, credential);
}
if (NULL == g_cur_engine.pefuncs->start_synth) {
/* synthesize text */
int ret = 0;
- ret = g_cur_engine.pefuncs->start_synth(temp_lang, temp_type, text, temp_speed, user_param);
+ ret = g_cur_engine.pefuncs->start_synth(temp_lang, temp_type, text, temp_speed, credential, user_param);
if (0 != ret) {
SLOG(LOG_ERROR, get_tag(), "[Engine Agent ERROR] ***************************************");
SLOG(LOG_ERROR, get_tag(), "[Engine Agent ERROR] * synthesize error : %s *", __ttsd_get_engine_error_code(ret));
SLOG(LOG_ERROR, get_tag(), "[Engine Agent ERROR] ***************************************");
if (NULL != temp_lang) free(temp_lang);
- return TTSD_ERROR_OPERATION_FAILED;
+ return ret;
}
if (NULL != temp_lang) free(temp_lang);
int ttsd_engine_agent_set_default_pitch(int pitch);
+int ttsd_engine_agent_is_credential_needed(int uid, bool* credential_needed);
+
int ttsd_engine_set_private_data(const char* key, const char* data);
int ttsd_engine_get_private_data(const char* key, char** data);
int ttsd_engine_unload_voice(const char* lang, int vctype);
-int ttsd_engine_start_synthesis(const char* lang, int vctype, const char* text, int speed, void* user_param);
+int ttsd_engine_start_synthesis(const char* lang, int vctype, const char* text, int speed, const char* credential, void* user_param);
int ttsd_engine_cancel_synthesis();
static GList *g_proc_list = NULL;
/* Function definitions */
-static int __synthesis(int uid);
+static int __synthesis(int uid, const char* credential);
static int __server_set_synth_control(ttsd_synthesis_control_e control)
{
static Eina_Bool __wait_synthesis(void *data)
{
/* get current play */
+ char* credential = (char*)data;
int uid = ttsd_data_get_current_playing();
if (uid > 0) {
g_wait_timer = NULL;
if (TTSD_SYNTHESIS_CONTROL_DONE == __server_get_synth_control()) {
/* Start next synthesis */
- __synthesis(uid);
+ __synthesis(uid, credential);
}
}
} else {
return EINA_FALSE;
}
-static int __synthesis(int uid)
+static int __synthesis(int uid, const char* credential)
{
SLOG(LOG_DEBUG, get_tag(), "===== SYNTHESIS START");
SECURE_SLOG(LOG_DEBUG, get_tag(), "ID : uid (%d), uttid(%d) ", g_utt.uid, g_utt.uttid);
SECURE_SLOG(LOG_DEBUG, get_tag(), "Voice : langauge(%s), type(%d), speed(%d)", speak_data->lang, speak_data->vctype, speak_data->speed);
SECURE_SLOG(LOG_DEBUG, get_tag(), "Text : %s", speak_data->text);
+ SECURE_SLOG(LOG_DEBUG, get_tag(), "Credential : %s", credential);
SLOG(LOG_DEBUG, get_tag(), "-----------------------------------------------------------");
int ret = 0;
__server_set_synth_control(TTSD_SYNTHESIS_CONTROL_DOING);
- ret = ttsd_engine_start_synthesis(speak_data->lang, speak_data->vctype, speak_data->text, speak_data->speed, NULL);
+ ret = ttsd_engine_start_synthesis(speak_data->lang, speak_data->vctype, speak_data->text, speak_data->speed, credential, NULL);
if (0 != ret) {
SLOG(LOG_ERROR, get_tag(), "[Server ERROR] * FAIL to start SYNTHESIS !!!! * ");
int pid = ttsd_data_get_pid(uid);
ttsdc_send_set_state_message(pid, uid, APP_STATE_READY);
} else {
- g_wait_timer = ecore_timer_add(0, __wait_synthesis, NULL);
+ g_wait_timer = ecore_timer_add(0, __wait_synthesis, (void*)credential);
}
if (NULL != speak_data) {
* TTS Server Functions for Client
*/
-int ttsd_server_initialize(int pid, int uid)
+int ttsd_server_initialize(int pid, int uid, bool* credential_needed)
{
if (false == g_is_engine) {
if (0 != ttsd_engine_agent_initialize_current_engine()) {
}
}
+ if (0 != ttsd_engine_agent_is_credential_needed(uid, credential_needed)) {
+ SLOG(LOG_ERROR, get_tag(), "Server ERROR] Fail to get credential necessity");
+ return TTSD_ERROR_OPERATION_FAILED;
+ }
if (0 != ttsd_data_new_client(pid, uid)) {
SLOG(LOG_ERROR, get_tag(), "[Server ERROR] Fail to add client info");
return TTSD_ERROR_OPERATION_FAILED;
return TTSD_ERROR_NONE;
}
-int ttsd_server_add_queue(int uid, const char* text, const char* lang, int voice_type, int speed, int utt_id)
+int ttsd_server_add_queue(int uid, const char* text, const char* lang, int voice_type, int speed, int utt_id, const char* credential)
{
app_state_e state;
if (0 > ttsd_data_get_client_state(uid, &state)) {
if (TTSD_SYNTHESIS_CONTROL_DOING == __server_get_synth_control()) {
SLOG(LOG_WARN, get_tag(), "[Server WARNING] Engine has already been running.");
} else {
- __synthesis(uid);
+ __synthesis(uid, credential);
}
}
return EINA_FALSE;
}
-int ttsd_server_play(int uid)
+int ttsd_server_play(int uid, const char* credential)
{
app_state_e state;
if (0 > ttsd_data_get_client_state(uid, &state)) {
if (TTSD_SYNTHESIS_CONTROL_DOING == __server_get_synth_control()) {
SLOG(LOG_WARN, get_tag(), "[Server WARNING] Engine has already been running.");
} else {
- __synthesis(uid);
+ __synthesis(uid, credential);
}
return TTSD_ERROR_NONE;
* Server API for client
*/
-int ttsd_server_initialize(int pid, int uid);
+int ttsd_server_initialize(int pid, int uid, bool* credential_needed);
int ttsd_server_finalize(int uid);
int ttsd_server_get_current_voice(int uid, char** language, int* voice_type);
-int ttsd_server_add_queue(int uid, const char* text, const char* lang, int voice_type, int speed, int utt_id);
+int ttsd_server_add_queue(int uid, const char* text, const char* lang, int voice_type, int speed, int utt_id, const char* credential);
-int ttsd_server_play(int uid);
+int ttsd_server_play(int uid, const char* credential);
int ttsd_server_stop(int uid);
#include <errno.h>
#include <stdbool.h>
+#include <tizen.h>
/**
* @addtogroup TTS_ENGINE_MODULE
#endif
/**
-* @brief Enumerations of error codes.
+ * @brief Enumeration for error code.
*/
typedef enum {
- TTSP_ERROR_NONE = 0, /**< Successful */
- TTSP_ERROR_OUT_OF_MEMORY = -ENOMEM, /**< Out of Memory */
- TTSP_ERROR_IO_ERROR = -EIO, /**< I/O error */
- TTSP_ERROR_INVALID_PARAMETER = -EINVAL, /**< Invalid parameter */
- TTSP_ERROR_OUT_OF_NETWORK = -ENETDOWN, /**< Out of network */
- TTSP_ERROR_INVALID_STATE = -0x0100021, /**< Invalid state */
- TTSP_ERROR_INVALID_VOICE = -0x0100022, /**< Invalid voice */
- TTSP_ERROR_OPERATION_FAILED = -0x0100025 /**< Operation failed */
+ TTSP_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ TTSP_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of Memory */
+ TTSP_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
+ TTSP_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,/**< Invalid parameter */
+ TTSP_ERROR_OUT_OF_NETWORK = TIZEN_ERROR_NETWORK_DOWN, /**< Network is down */
+ TTSP_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< No answer from the daemon */
+ TTSP_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,/**< Permission denied */
+ TTSP_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< TTS NOT supported */
+ TTSP_ERROR_INVALID_STATE = TIZEN_ERROR_TTS | 0x01, /**< Invalid state */
+ TTSP_ERROR_INVALID_VOICE = TIZEN_ERROR_TTS | 0x02, /**< Invalid voice */
+ TTSP_ERROR_ENGINE_NOT_FOUND = TIZEN_ERROR_TTS | 0x03, /**< No available engine */
+ TTSP_ERROR_OPERATION_FAILED = TIZEN_ERROR_TTS | 0x04, /**< Operation failed */
+ TTSP_ERROR_AUDIO_POLICY_BLOCKED = TIZEN_ERROR_TTS | 0x05 /**< Audio policy blocked */
} ttsp_error_e;
/**
typedef int (*ttspe_set_pitch)(int pitch);
/**
+* @brief Gets credential necessity.
+*
+* @return @c true to be needed app credential, \n @c false not to be needed app credential.
+*
+*/
+typedef bool (*ttspe_need_app_credential)(void);
+
+/**
* @brief Load voice of the engine.
*
* @param[in] language language
* @param[in] type A voice type
* @param[in] text Texts
* @param[in] speed A speaking speed
+* @parma[in] credential The app credential to allow recognition
* @param[in] user_data The user data to be passed to the callback function
*
* @return 0 on success, otherwise a negative error value
* @retval #TTSP_ERROR_INVALID_VOICE Invalid voice
* @retval #TTSP_ERROR_OPERATION_FAILED Operation failed
* @retval #TTSP_ERROR_OUT_OF_NETWORK Out of network
+* @retval #TTSP_ERROR_PERMISSION_DENIED Permission denied
*
* @post This function invokes ttspe_result_cb().
*
* @see ttspe_result_cb()
* @see ttspe_cancel_synthesis()
*/
-typedef int (*ttspe_start_synthesis)(const char* language, int type, const char* text, int speed, void* user_data);
+typedef int (*ttspe_start_synthesis)(const char* language, int type, const char* text, int speed, const char* credential, void* user_data);
/**
* @brief Cancels voice synthesis.
/* Load / Unload voice */
ttspe_load_voice load_voice; /**< Load voice */
ttspe_unload_voice unload_voice; /**< Unload voice */
+ ttspe_need_app_credential need_app_credential; /**< Get app credential necessity*/
/* Control synthesis */
ttspe_start_synthesis start_synth; /**< Start synthesis */