+ }
+
+ /* 2. Request wav play */
+ if (NULL != sound) {
+ int id = 0;
+ intptr_t puid = (intptr_t)uid;
+ ret = wav_player_start(sound, SOUND_TYPE_MEDIA, __sttd_stop_sound_completed_cb, (void*)puid, &id);
+ if (WAV_PLAYER_ERROR_NONE != ret) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to play wav");
+ } else {
+ SLOG(LOG_DEBUG, TAG_STTD, "[Server] Play wav : %s", sound);
+ }
+
+ free(sound);
+
+ g_processing_timer = ecore_timer_add(g_processing_timeout, __time_out_for_processing, NULL);
+
+ return STTD_RESULT_STATE_NOT_DONE;
+ } else {
+ SLOG(LOG_DEBUG, TAG_STTD, "[Server] No sound play");
+
+ /* Unset audio session */
+ ret = sttd_recorder_unset_audio_session();
+ if (0 != ret) {
+ SLOG(LOG_ERROR, TAG_STTD, "[Server ERROR] Fail to unset session : %d", ret);
+ return ret;
+ }
+
+ /* Stop engine */
+ ret = sttd_engine_agent_recognize_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 ret;
+ }
+
+ /* change uid state */
+ sttd_client_set_state(uid, APP_STATE_PROCESSING);
+
+ /* Notify uid state change */
+ sttdc_send_set_state(uid, APP_STATE_PROCESSING);
+
+ SLOG(LOG_DEBUG, TAG_STTD, "[Server SUCCESS] Stop recognition");
+
+ g_processing_timer = ecore_timer_add(g_processing_timeout, __time_out_for_processing, NULL);
+
+ return STTD_RESULT_STATE_DONE;
+ }