SLOG(LOG_DEBUG, TAG_STTC, "<<<< stt hello");
} else {
+ if (dbus_error_is_set(&err)) {
+ SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Get arguments error (%s)", err.message);
+ dbus_error_free(&err);
+ }
+
+ SLOG(LOG_ERROR, TAG_STTC, "STT_ERROR_TIME_OUT");
result = STT_ERROR_TIMED_OUT;
}
} else {
/* create a signal & check for errors */
msg = dbus_message_new_method_call(
STT_SERVER_SERVICE_NAME,
- STT_SERVER_SERVICE_OBJECT_PATH,
- STT_SERVER_SERVICE_INTERFACE,
- STT_METHOD_START);
+ STT_SERVER_SERVICE_OBJECT_PATH,
+ STT_SERVER_SERVICE_INTERFACE,
+ STT_METHOD_START);
if (NULL == msg) {
SLOG(LOG_ERROR, TAG_STTC, ">>>> stt start : Fail to make message");
SLOG(LOG_DEBUG, TAG_STTC, ">>>> stt start : uid(%d), language(%s), type(%s)", uid, lang, type);
}
+ if (NULL == credential)
+ credential = strdup("NULL");
+
dbus_message_append_args(msg,
DBUS_TYPE_INT32, &uid,
DBUS_TYPE_STRING, &lang,
free(engine->pdfuncs);
free(engine->engine_path);
free(engine);
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
/* engine error check */
ret = engine->pefuncs->initialize(result_cb, silence_cb);
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to initialize : %s", __stt_get_engine_error_code(ret));
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
ret = engine->pefuncs->foreach_langs(__supported_language_cb, (void*)lang_list);
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] get language list error : %s", __stt_get_engine_error_code(ret));
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
ret = engine->pefuncs->foreach_langs(__supported_language_cb, &lang_list);
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] get language list error : %s", __stt_get_engine_error_code(ret));
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
GSList *iter = NULL;
ret = engine->pefuncs->get_audio_format(types, rate, channels);
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to get audio format : %s", __stt_get_engine_error_code(ret));
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
return STTP_ERROR_NOT_SUPPORTED_FEATURE;
} else if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to set silence detection : %d", ret);
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to get app agreement : %s", __stt_get_engine_error_code(ret));
*value = false;
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to start recognition : %s", __stt_get_engine_error_code(ret));
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to start recognition : lang(%s), recognition_type(%s), credential(%s)", lang, recognition_type, credential);
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
int ret = engine->pefuncs->set_recording(data, length);
if (0 != ret) {
SLOG(LOG_WARN, stt_tag(), "[Engine WARNING] Fail to set recording : %s", __stt_get_engine_error_code(ret));
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
int ret = engine->pefuncs->stop();
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to stop : %s", __stt_get_engine_error_code(ret));
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
int ret = engine->pefuncs->cancel();
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to cancel : %s", __stt_get_engine_error_code(ret));
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
int ret = engine->pefuncs->foreach_result_time(time_info, callback, user_data);
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to foreach result time : %s", __stt_get_engine_error_code(ret));
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
int ret = engine->pefuncs->start_file(lang, recognition_type, filepath, audio_type, sample_rate, user_param);
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to start file recognition : %s", __stt_get_engine_error_code(ret));
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
int ret = engine->pefuncs->cancel_file();
if (0 != ret) {
SLOG(LOG_ERROR, stt_tag(), "[Engine ERROR] Fail to start file recognition : %s", __stt_get_engine_error_code(ret));
- return STTP_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef enum {
- STT_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
- STT_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of Memory */
- STT_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
- STT_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,/**< Invalid parameter */
- STT_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< No answer from the daemon */
- STT_ERROR_RECORDER_BUSY = TIZEN_ERROR_RESOURCE_BUSY, /**< Device or resource busy */
- STT_ERROR_OUT_OF_NETWORK = TIZEN_ERROR_NETWORK_DOWN, /**< Network is down */
- STT_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,/**< Permission denied */
- STT_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< STT NOT supported */
- STT_ERROR_INVALID_STATE = TIZEN_ERROR_STT | 0x01, /**< Invalid state */
- STT_ERROR_INVALID_LANGUAGE = TIZEN_ERROR_STT | 0x02, /**< Invalid language */
- STT_ERROR_ENGINE_NOT_FOUND = TIZEN_ERROR_STT | 0x03, /**< No available engine */
- STT_ERROR_OPERATION_FAILED = TIZEN_ERROR_STT | 0x04, /**< Operation failed */
- STT_ERROR_NOT_SUPPORTED_FEATURE = TIZEN_ERROR_STT | 0x05 /**< Not supported feature of current engine */
+ STT_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ STT_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of Memory */
+ STT_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
+ STT_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,/**< Invalid parameter */
+ STT_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< No answer from the daemon */
+ STT_ERROR_RECORDER_BUSY = TIZEN_ERROR_RESOURCE_BUSY, /**< Device or resource busy */
+ STT_ERROR_OUT_OF_NETWORK = TIZEN_ERROR_NETWORK_DOWN, /**< Network is down */
+ STT_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED,/**< Permission denied */
+ STT_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< STT NOT supported */
+ STT_ERROR_INVALID_STATE = TIZEN_ERROR_STT | 0x01, /**< Invalid state */
+ STT_ERROR_INVALID_LANGUAGE = TIZEN_ERROR_STT | 0x02, /**< Invalid language */
+ STT_ERROR_ENGINE_NOT_FOUND = TIZEN_ERROR_STT | 0x03, /**< No available engine */
+ STT_ERROR_OPERATION_FAILED = TIZEN_ERROR_STT | 0x04, /**< Operation failed */
+ STT_ERROR_NOT_SUPPORTED_FEATURE = TIZEN_ERROR_STT | 0x05, /**< Not supported feature of current engine */
+ STT_ERROR_NO_SPEECH = TIZEN_ERROR_STT | 0x06 /**< No speech while recording */
} stt_error_e;
/**
if (NULL == g_client_list) {
SLOG(LOG_ERROR, TAG_STTD, "[Client Data ERROR] Fail to add new client");
- return -1;
+ return STTD_ERROR_OPERATION_FAILED;
}
#ifdef CLIENT_DATA_DEBUG
g_conn_listener = NULL;
g_conn_sender = NULL;
+ SLOG(LOG_DEBUG, TAG_STTD, "[Server] Close dbus connection");
+
return 0;
}
handle = dlopen(filepath, RTLD_LAZY);
if (!handle) {
- SECURE_SLOG(LOG_WARN, TAG_STTD, "[Engine Agent] Invalid engine : %s", filepath);
+ SECURE_SLOG(LOG_WARN, TAG_STTD, "[Engine Agent] Invalid engine : %s, error(%s)", filepath, (NULL == dlerror()) ? "NULL" : dlerror());
return STTD_ERROR_ENGINE_NOT_FOUND;
}
ret = stt_engine_load(engine->engine_id, engine->engine_path);
if (0 != ret) {
SECURE_SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to load engine : id(%d) path(%s)", engine->engine_id, engine->engine_path);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
ret = stt_engine_initialize(engine->engine_id, __result_cb, __detect_silence_cb);
if (0 != ret) {
SECURE_SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to initialize engine : id(%d) path(%s)", engine->engine_id, engine->engine_path);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
ret = stt_engine_set_silence_detection(engine->engine_id, g_default_silence_detected);
free(tmp_lang);
} else {
SECURE_SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to get first language from engine : %d %s", engine->engine_id, engine->engine_name);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
#ifndef AUDIO_CREATE_ON_START
ret = stt_engine_get_audio_type(engine->engine_id, &atype, &rate, &channels);
if (0 != ret) {
SECURE_SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to get audio type : %d %s", engine->engine_id, engine->engine_name);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
ret = sttd_recorder_create(engine->engine_id, uid, atype, channels, rate);
if (0 != ret) {
SECURE_SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to create recorder : %d %s", engine->engine_id, engine->engine_name);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
#endif
int ret = stt_engine_get_supported_langs(engine->engine_id, lang_list);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] get language list error(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
/* get default language */
bool is_valid = false;
- if (0 != stt_engine_is_valid_language(engine->engine_id, g_default_language, &is_valid)) {
+ int ret = -1;
+ ret = stt_engine_is_valid_language(engine->engine_id, g_default_language, &is_valid);
+ if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to check valid language");
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
if (true == is_valid) {
ret = stt_engine_need_app_credential(engine->engine_id, &temp);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to get to support recognition type : %d", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
*credential = temp;
ret = stt_engine_support_recognition_type(engine->engine_id, type, &temp);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to get to support recognition type : %d", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
*support = temp;
char* temp = NULL;
if (0 == strncmp(lang, "default", strlen("default"))) {
bool is_valid = false;
- if (0 != stt_engine_is_valid_language(engine->engine_id, g_default_language, &is_valid)) {
+ ret = stt_engine_is_valid_language(engine->engine_id, g_default_language, &is_valid);
+ if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to check valid language");
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
if (true == is_valid) {
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Recognition start error(%d)", ret);
sttd_recorder_destroy(engine->engine_id);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
#ifdef AUDIO_CREATE_ON_START
ret = stt_engine_get_audio_type(engine->engine_id, &atype, &rate, &channels);
if (0 != ret) {
SECURE_SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to get audio type : %d %s", engine->engine_id, engine->engine_name);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
SLOG(LOG_DEBUG, TAG_STTD, "[Engine Agent] Create recorder");
ret = sttd_recorder_create(engine->engine_id, uid, atype, channels, rate);
if (0 != ret) {
SECURE_SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to create recorder : %d %s", engine->engine_id, engine->engine_name);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
#endif
int ret = stt_engine_set_recording_data(engine->engine_id, data, length);
if (0 != ret) {
SLOG(LOG_WARN, TAG_STTD, "[Engine Agent WARNING] set recording error(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
ret = sttd_recorder_stop(engine->engine_id);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to stop recorder : result(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
#ifdef AUDIO_CREATE_ON_START
ret = stt_engine_recognize_stop(engine->engine_id);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] stop recognition error(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
SLOG(LOG_DEBUG, TAG_STTD, "[Engine Agent Success] Stop engine");
ret = stt_engine_recognize_cancel(engine->engine_id);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] cancel recognition error(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
SLOG(LOG_DEBUG, TAG_STTD, "[Engine Agent] Stop recorder");
ret = sttd_recorder_stop(engine->engine_id);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] Fail to stop recorder : result(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
#ifdef AUDIO_CREATE_ON_START
ret = stt_engine_check_app_agreed(engine->engine_id, appid, result);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Engine Agent ERROR] cancel recognition error(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
}
return 0;
-}
\ No newline at end of file
+}
ecore_timer_del(g_check_client_timer);
}
+ sttd_dbus_close_connection();
+
stt_network_finalize();
sttd_finalize();
STTD_ERROR_INVALID_LANGUAGE = TIZEN_ERROR_STT | 0x02, /**< Invalid language */
STTD_ERROR_ENGINE_NOT_FOUND = TIZEN_ERROR_STT | 0x03, /**< No available engine */
STTD_ERROR_OPERATION_FAILED = TIZEN_ERROR_STT | 0x04, /**< Operation failed */
- STTD_ERROR_NOT_SUPPORTED_FEATURE = TIZEN_ERROR_STT | 0x05 /**< Not supported feature of current engine */
+ STTD_ERROR_NOT_SUPPORTED_FEATURE = TIZEN_ERROR_STT | 0x05, /**< Not supported feature of current engine */
+ STTD_ERROR_NO_SPEECH = TIZEN_ERROR_STT | 0x06 /**< No speech while recording */
} stt_error_e;
typedef enum {
if (STTP_SILENCE_TYPE_NO_RECORD_TIMEOUT == type) {
SLOG(LOG_DEBUG, TAG_STTD, "Silence Detection type - No Record");
ecore_main_loop_thread_safe_call_async(__cancel_by_no_record, NULL);
+ if (0 != sttdc_send_error_signal(uid, STTP_ERROR_NO_SPEECH, "No speech while recording")) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] No speech while recording");
+ }
} else if (STTP_SILENCE_TYPE_END_OF_SPEECH_DETECTED == type) {
SLOG(LOG_DEBUG, TAG_STTD, "Silence Detection type - End of Speech");
ecore_main_loop_thread_safe_call_async(__stop_by_silence, NULL);
ret = sttd_recorder_initialize(__server_audio_recorder_callback, __server_audio_interrupt_callback);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to initialize recorder : result(%d)", ret);
+ return ret;
}
/* Engine Agent initialize */
}
}
+ int ret = STTD_ERROR_NONE;
+
/* check if uid is valid */
app_state_e state;
if (0 == sttd_client_get_state(uid, &state)) {
}
/* load engine */
- if (0 != sttd_engine_agent_load_current_engine(uid, NULL)) {
+ ret = sttd_engine_agent_load_current_engine(uid, NULL);
+ if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to load default engine");
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
- if (0 != sttd_engine_agent_get_option_supported(uid, silence)) {
+ ret = sttd_engine_agent_get_option_supported(uid, silence);
+ if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get engine options supported");
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
- if (0 != sttd_engine_agent_is_credential_needed(uid, credential)) {
+ ret = sttd_engine_agent_is_credential_needed(uid, credential);
+ if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get credential necessity");
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
/* Add client information to client manager */
- if (0 != sttd_client_add(pid, uid)) {
+ ret = sttd_client_add(pid, uid);
+ if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to add client info");
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
return STTD_ERROR_NONE;
/* unload engine, if ref count of client is 0 */
if (0 == sttd_client_get_ref_count()) {
- sttd_dbus_close_connection();
+// sttd_dbus_close_connection();
ecore_timer_add(0, __quit_ecore_loop, NULL);
}
ret = sttd_engine_agent_get_engine_list(engine_list);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get engine list");
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
return STTD_ERROR_NONE;
ret = sttd_engine_agent_load_current_engine(uid, engine_id);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to set engine : %d", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
ret = sttd_engine_agent_get_option_supported(uid, silence);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to engine options : %d", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
if (0 != sttd_engine_agent_is_credential_needed(uid, credential)) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get credential necessity");
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
return STTD_ERROR_NONE;
ret = sttd_engine_agent_get_current_engine(uid, engine_id);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get engine : %d", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
return STTD_ERROR_NONE;
ret = sttd_engine_agent_check_app_agreed(uid, appid, &temp);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get engine available : %d", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
if (true == temp) {
int ret = sttd_engine_agent_supported_langs(uid, lang_list);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get supported languages");
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
SLOG(LOG_DEBUG, TAG_STTD, "[Server SUCCESS] sttd_server_get_supported_languages");
int ret = sttd_engine_agent_get_default_lang(uid, current_lang);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get default language :result(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
SLOG(LOG_DEBUG, TAG_STTD, "[Server SUCCESS] Get default language");
int ret = sttd_engine_agent_is_recognition_type_supported(uid, type, &temp);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get recognition type supported : result(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
*support = (int)temp;
int ret = sttd_client_set_start_sound(uid, file);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to set start sound file : result(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
int ret = sttd_client_set_stop_sound(uid, file);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to set start sound file : result(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
return 0;
ret = sttd_engine_agent_check_app_agreed(uid, appid, &temp);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get engine available : %d", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
if (false == temp) {
}
char* sound = NULL;
- if (0 != sttd_client_get_start_sound(uid, &sound)) {
+ ret = sttd_client_get_start_sound(uid, &sound);
+ if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get start beep sound");
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
if (0 != stt_client_set_current_recognition(uid)) {
sttd_client_set_state(uid, APP_STATE_READY);
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to start recorder : result(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
/* Notify uid state change */
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to cancel recognize");
}
if (NULL != sound) free(sound);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
/* 2. Request wav play */
ret = sttd_recorder_unset_audio_session();
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to unset session : %d", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
/* Stop engine */
if (0 != ret) {
stt_client_unset_current_recognition();
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to stop engine : result(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
/* change uid state */
int ret = sttd_recorder_unset_audio_session();
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to unset session : %d", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
}
int ret = sttd_engine_agent_recognize_cancel(uid);
if (0 != ret) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to cancel : result(%d)", ret);
- return STTD_ERROR_OPERATION_FAILED;
+ return ret;
}
/* Notify uid state change */
STTP_ERROR_INVALID_LANGUAGE = TIZEN_ERROR_STT | 0x02, /**< Invalid language */
STTP_ERROR_ENGINE_NOT_FOUND = TIZEN_ERROR_STT | 0x03, /**< No available engine */
STTP_ERROR_OPERATION_FAILED = TIZEN_ERROR_STT | 0x04, /**< Operation failed */
- STTP_ERROR_NOT_SUPPORTED_FEATURE = TIZEN_ERROR_STT | 0x05 /**< Not supported feature of current engine */
+ STTP_ERROR_NOT_SUPPORTED_FEATURE = TIZEN_ERROR_STT | 0x05, /**< Not supported feature of current engine */
+ STTP_ERROR_NO_SPEECH = TIZEN_ERROR_STT | 0x06 /**< No speech while recording */
}sttp_error_e;
/**