static Ecore_Timer* g_check_client_timer = NULL;
Ecore_Timer* g_recording_timer = NULL;
Ecore_Timer* g_processing_timer = NULL;
+static Ecore_Timer *g_stop_by_silence_timer = NULL;
static int g_recording_log_count = 0;
SLOG(LOG_INFO, TAG_STTD, "=====");
SLOG(LOG_DEBUG, TAG_STTD, " ");
+ g_stop_by_silence_timer = NULL;
return EINA_FALSE;
}
} else if (STTE_SPEECH_STATUS_END_POINT_DETECTED == status) {
SLOG(LOG_DEBUG, TAG_STTD, "End Speech detected");
ecore_thread_main_loop_begin();
- ecore_timer_add(0, __stop_by_silence, NULL);
+ if (NULL == g_stop_by_silence_timer) {
+ g_stop_by_silence_timer = ecore_timer_add(0, __stop_by_silence, NULL);
+ }
ecore_thread_main_loop_end();
}
} else {
}
}
+ if (NULL != g_stop_by_silence_timer) {
+ ecore_timer_del(g_stop_by_silence_timer);
+ g_stop_by_silence_timer = NULL;
+ }
+
SLOG(LOG_INFO, TAG_STTD, "[Server INFO] stt_cancel is invoked while state is (%d)", state);
if (0 != sttd_engine_agent_recognize_cancel(uid)) {
return ret;
}
+ if (0 != stt_client_set_current_recognition(uid)) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Current STT is busy because of recording or processing");
+ return STTD_ERROR_RECORDER_BUSY;
+ }
+
if (NULL != g_recording_timer) {
ecore_timer_del(g_recording_timer);
g_recording_timer = NULL;
g_processing_timer = NULL;
}
+ if (NULL != g_stop_by_silence_timer) {
+ ecore_timer_del(g_stop_by_silence_timer);
+ g_stop_by_silence_timer = NULL;
+ }
+
char* sound = NULL;
ret = sttd_client_get_start_sound(uid, &sound);
if (0 != ret) {
return ret;
}
- if (0 != stt_client_set_current_recognition(uid)) {
- SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Current STT is busy because of recording or processing");
- if (NULL != sound) free(sound);
- return STTD_ERROR_RECORDER_BUSY;
- }
-
/* engine start recognition */
SLOG(LOG_INFO, TAG_STTD, "[Server] start : uid(%u), lang(%s), recog_type(%s)",
uid, lang, recognition_type);
g_processing_timer = NULL;
}
+ if (NULL != g_stop_by_silence_timer) {
+ ecore_timer_del(g_stop_by_silence_timer);
+ g_stop_by_silence_timer = NULL;
+ }
+
char* sound = NULL;
if (0 != sttd_client_get_stop_sound(uid, &sound)) {
SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to get start beep sound");
g_processing_timer = NULL;
}
+ if (NULL != g_stop_by_silence_timer) {
+ ecore_timer_del(g_stop_by_silence_timer);
+ g_stop_by_silence_timer = NULL;
+ }
+
if (APP_STATE_RECORDING == state) {
/* Unset audio session */
int ret = sttd_recorder_unset_audio_session();
SLOG(LOG_INFO, TAG_STTD, "[Server INFO] End sttd_server_cancel_file");
return ret;
-}
\ No newline at end of file
+}