{
SLOG(LOG_DEBUG, tts_tag(), "[Engine Agent DEBUG] load current engine START");
- if (false == __is_agent_initialized()) {
- SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Not Initialized");
- return TTSD_ERROR_INVALID_STATE;
- }
-
if (NULL == callback) {
SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Invalid engine");
return TTSD_ERROR_ENGINE_NOT_FOUND;
return TTSD_ERROR_ENGINE_NOT_FOUND;
}
+ if (false == __is_agent_initialized()) {
+ SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Not Initialized");
+ return TTSD_ERROR_INVALID_STATE;
+ }
+
/* check whether current engine is loaded or not */
if (__is_engine_loaded()) {
SLOG(LOG_INFO, tts_tag(), "[Engine Agent] Engine has already been loaded ");
int ttsd_engine_load_voice(const char* lang, const int vctype)
{
+ if (NULL == lang) {
+ SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] No language parameter");
+ return TTSD_ERROR_INVALID_PARAMETER;
+ }
+
int ret = __check_engine_initialized_and_loaded();
if (TTSD_ERROR_NONE != ret) {
SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Precondition is not met(%s)", get_error_message(ret));
return ret;
}
- if (NULL == lang) {
- SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] No language parameter");
- return TTSD_ERROR_INVALID_PARAMETER;
- }
-
/* 1. Find voice info */
ttsvoice_s* data = __get_ttsvoice(lang, vctype);
if (NULL == data) {
int ttsd_engine_unload_voice(const char* lang, const int vctype)
{
+ if (NULL == lang) {
+ SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] No language parameter");
+ return TTSD_ERROR_INVALID_PARAMETER;
+ }
+
int ret = __check_engine_initialized_and_loaded();
if (TTSD_ERROR_NONE != ret) {
SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Precondition is not met(%s)", get_error_message(ret));
return ret;
}
- if (NULL == lang) {
- SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] No language parameter");
- return TTSD_ERROR_INVALID_PARAMETER;
- }
-
/* 1. Find voice info */
ttsvoice_s* data = __get_ttsvoice(lang, vctype);
if (NULL == data) {
int ttsd_engine_get_default_voice(char** lang, int* vctype)
{
+ if (NULL == lang || NULL == vctype) {
+ SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] BAD Parameter");
+ return TTSD_ERROR_INVALID_PARAMETER;
+ }
+
int ret = __check_engine_initialized_and_loaded();
if (TTSD_ERROR_NONE != ret) {
SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Precondition is not met(%s)", get_error_message(ret));
return ret;
}
- if (NULL == lang || NULL == vctype) {
- SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] BAD Parameter");
- return TTSD_ERROR_INVALID_PARAMETER;
- }
-
if (NULL != g_engine_info->default_lang) {
*lang = strdup(g_engine_info->default_lang);
*vctype = g_engine_info->default_vctype;
int ttsd_engine_set_private_data(const char* key, const char* data)
{
+ if (NULL == key) {
+ SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Invalid parameter");
+ return TTSD_ERROR_INVALID_PARAMETER;
+ }
+
int ret = __check_engine_initialized_and_loaded();
if (TTSD_ERROR_NONE != ret) {
SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Precondition is not met(%s)", get_error_message(ret));
return ret;
}
- if (NULL == key) {
- SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Invalid parameter");
- return TTSD_ERROR_INVALID_PARAMETER;
- }
-
if (NULL == g_engine_info->callbacks->private_data_set) {
SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Not supported feature");
return TTSD_ERROR_NOT_SUPPORTED_FEATURE;
int ttsd_engine_get_private_data(const char* key, char** data)
{
- int ret = __check_engine_initialized_and_loaded();
- if (TTSD_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Precondition is not met(%s)", get_error_message(ret));
- return ret;
- }
-
if (NULL == key || NULL == data) {
SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Invalid parameter");
return TTSD_ERROR_INVALID_PARAMETER;
}
+ int ret = __check_engine_initialized_and_loaded();
+ if (TTSD_ERROR_NONE != ret) {
+ SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Precondition is not met(%s)", get_error_message(ret));
+ return ret;
+ }
if (NULL == g_engine_info->callbacks->private_data_requested) {
SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Not supported feature");
int ttsd_engine_check_app_agreed(const char* appid, bool* is_agreed)
{
- int ret = __check_engine_initialized_and_loaded();
- if (TTSD_ERROR_NONE != ret) {
- SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Precondition is not met(%s)", get_error_message(ret));
- return ret;
- }
-
if (NULL == appid || NULL == is_agreed) {
SLOG(LOG_WARN, tts_tag(), "[Engine Agent WARNING] Invalid parameter, appid is NULL");
return TTSD_ERROR_NONE;
}
+ int ret = __check_engine_initialized_and_loaded();
+ if (TTSD_ERROR_NONE != ret) {
+ SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Precondition is not met(%s)", get_error_message(ret));
+ return ret;
+ }
if (NULL == g_engine_info->callbacks->check_app_agreed) {
SLOG(LOG_ERROR, tts_tag(), "[Engine Agent ERROR] Not supported feature");