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
////////////////////////////////////////////////////////////////////////////////