return;
}
-void __server_recognition_result_callback(stte_result_event_e event, const char* type,
+int __server_recognition_result_callback(stte_result_event_e event, const char* type,
const char** data, int data_count, const char* msg, void *user_data)
{
// critical section
SLOG(LOG_DEBUG, TAG_STTD, "=====");
SLOG(LOG_DEBUG, TAG_STTD, " ");
pthread_mutex_unlock(&stte_result_mutex);
- return;
+ return STTD_ERROR_OPERATION_FAILED;
}
SLOG(LOG_DEBUG, TAG_STTD, "[Server] uid (%d), event(%d)", uid, event);
SLOG(LOG_DEBUG, TAG_STTD, " ");
pthread_mutex_unlock(&stte_result_mutex);
- return;
+ return STTD_ERROR_NONE;
}
bool __server_result_time_callback(int index, stte_result_time_event_e event, const char* text, long start_time, long end_time, void* user_data)
SLOG(LOG_DEBUG, TAG_STTD, "[Server] index(%d) event(%d) text(%s) start(%ld) end(%ld)",
index, event, text, start_time, end_time);
- if (0 == index) {
- int ret;
- ret = sttd_config_time_add(index, (int)event, text, start_time, end_time);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to add time info");
- pthread_mutex_unlock(&stte_result_time_mutex);
- return false;
- }
- } else {
+ int ret;
+ ret = sttd_config_time_add(index, (int)event, text, start_time, end_time);
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to add time info");
pthread_mutex_unlock(&stte_result_time_mutex);
return false;
}
return true;
}
-void __server_speech_status_callback(stte_speech_status_e status, void *user_param)
+int __server_speech_status_callback(stte_speech_status_e status, void *user_param)
{
SLOG(LOG_DEBUG, TAG_STTD, "===== Speech status detected Callback");
app_state_e state;
if (0 != sttd_client_get_state(uid, &state)) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] uid is not valid ");
- return;
+ return STTD_ERROR_OPERATION_FAILED;
}
if (APP_STATE_RECORDING != state) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Current state is not recording");
- return;
+ return STTD_ERROR_INVALID_STATE;
}
if (STTE_SPEECH_STATUS_BEGINNING_POINT_DETECTED == status) {
SLOG(LOG_DEBUG, TAG_STTD, "=====");
SLOG(LOG_DEBUG, TAG_STTD, " ");
- return;
+ return STTD_ERROR_NONE;
}
-void __server_error_callback(stte_error_e error, const char* msg)
+int __server_error_callback(stte_error_e error, const char* msg)
{
SLOG(LOG_DEBUG, TAG_STTD, "[Server] Error Callback is called");
- return;
+ return STTD_ERROR_NONE;
}
void __sttd_server_engine_changed_cb(const char* engine_id, const char* language, bool support_silence, bool need_credential, void* user_data)