X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fw-input-stt-engine.cpp;h=be508bfc8b7eba6bd50d628b4669182ce03b3503;hb=75c40942e44c112450d943b0a61aae6ff8414af6;hp=92075d59a4d7b723df47fd553d48804dbb314f82;hpb=71cb4fbf92107088a3c677a9700aed39a9c05290;p=platform%2Fcore%2Fuifw%2Finputdelegator.git diff --git a/src/w-input-stt-engine.cpp b/src/w-input-stt-engine.cpp index 92075d5..be508bf 100755 --- a/src/w-input-stt-engine.cpp +++ b/src/w-input-stt-engine.cpp @@ -41,93 +41,6 @@ static stt_h g_stt; -const char * error_string(int ecode) -{ - const char *str = NULL; - switch (ecode) { - case STT_ERROR_OUT_OF_MEMORY: - str = "STT_ERROR_OUT_OF_MEMORY"; - break; - case STT_ERROR_IO_ERROR: - str = "STT_ERROR_IO_ERROR"; - break; - case STT_ERROR_INVALID_PARAMETER: - str = "STT_ERROR_INVALID_PARAMETER"; - break; - case STT_ERROR_TIMED_OUT: - str = "STT_ERROR_TIMED_OUT"; - break; - case STT_ERROR_RECORDER_BUSY: - str = "STT_ERROR_RECORDER_BUSY"; - break; - case STT_ERROR_OUT_OF_NETWORK: - str = "STT_ERROR_OUT_OF_NETWORK"; - break; - case STT_ERROR_INVALID_STATE: - str = " STT_ERROR_INVALID_STATE"; - break; - case STT_ERROR_INVALID_LANGUAGE: - str = "STT_ERROR_INVALID_LANGUAGE"; - break; - case STT_ERROR_ENGINE_NOT_FOUND: - str = "STT_ERROR_ENGINE_NOT_FOUND"; - break; - case STT_ERROR_OPERATION_FAILED: - str = "STT_ERROR_OPERATION_FAILED"; - break; - case STT_ERROR_NOT_SUPPORTED_FEATURE: - str = "STT_ERROR_NOT_SUPPORTED_FEATURE"; - break; - } - return str; -} - -void voice_stt_set_silence_detection_func(bool bEnable) -{ - int ret = STT_ERROR_NONE; - - stt_option_silence_detection_e s_option; - - if(bEnable) - s_option = STT_OPTION_SILENCE_DETECTION_TRUE; - else - s_option = STT_OPTION_SILENCE_DETECTION_FALSE; - - ret = stt_set_silence_detection(g_stt, s_option); - if (STT_ERROR_NONE != ret) { - PRINTFUNC(DLOG_ERROR, "stt_set_silence_detection Failed : error(%d) = %s", ret, error_string((stt_error_e)ret)); - } else { - PRINTFUNC(NO_PRINT, "stt_set_silence_detection Successful"); - } -} - - -//////////////////////////////////////////////////////////////////////////////// -// STT Callback functions -//////////////////////////////////////////////////////////////////////////////// - -void on_feedback(stt_h handle) -{ - int is_sound = 0; - int is_sound_vibe = 0; - - if(vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &is_sound)) { - PRINTFUNC(DLOG_ERROR, "get sound status failed."); - } - - if(vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &is_sound_vibe)) { - PRINTFUNC(DLOG_ERROR, "get vibe status failed."); - } - - if (is_sound || is_sound_vibe) { - stt_set_start_sound(handle, "/usr/share/ise-voice-input/audio/voice_start.wav"); - stt_set_stop_sound(handle, "/usr/share/ise-voice-input/audio/voice_stop.wav"); - } else { - stt_unset_start_sound(handle); - stt_unset_stop_sound(handle); - } -} - //////////////////////////////////////////////////////////////////////////////// // STT APIs callers ////////////////////////////////////////////////////////////////////////////////