*/
int ttsd_send_error(ttse_error_e error, const char* msg)
{
+ int uid = g_utt.uid;
+ int uttid = g_utt.uttid;
+ int tmp_pid = ttsd_data_get_pid(uid);
+
+ SLOG(LOG_ERROR, tts_tag(), "[SERVER ERROR] Error msg from engine, pid(%d), uid(%d), uttid(%d), error(%d), msg(%s)", tmp_pid, uid, uttid, error, msg);
+
+ __server_set_synth_control(TTSD_SYNTHESIS_CONTROL_EXPIRED);
+
+ if (0 != ttsd_player_clear(uid))
+ SLOG(LOG_WARN, tts_tag(), "[Server] Fail to ttsd_player_stop()");
+
+ if (0 != ttsd_data_clear_data(uid))
+ SLOG(LOG_WARN, tts_tag(), "[Server] Fail to ttsd_data_clear_data()");
+
+ if (0 != ttsdc_send_error_message(tmp_pid, uid, uttid, error, (char*)msg))
+ SLOG(LOG_WARN, tts_tag(), "[Server] Fail to ttsdc_send_error_message()");
+
+ if (0 != ttsd_data_set_client_state(uid, APP_STATE_READY))
+ SLOG(LOG_WARN, tts_tag(), "[Server] Fail to ttsd_data_set_client_state()");
+
+ if (0 != ttsdc_send_set_state_message(tmp_pid, uid, APP_STATE_READY))
+ SLOG(LOG_WARN, tts_tag(), "[Server] Fail to ttsdc_send_set_state_message()");
+
return 0;
}