if (h > 3900){ // to avoid Textblock size overflow (limit : 4000x4000)
PRINTFUNC(DLOG_ERROR, "Stop STT to avoid text block overflow");
- if(voicedata->sttmanager->GetCurrent() == STT_STATE_RECORDING || voicedata->sttmanager->GetCurrent() == STT_STATE_PROCESSING) {
- PRINTFUNC(DLOG_DEBUG, "STT_STATE_RECORDING or STT_STATE_PROCESSING\n");
- try{
- voicedata->sttmanager->Cancel();
- }catch(is::stt::SttException &e){
- PRINTFUNC(DLOG_ERROR, "reason : %s", e.what());
+ if (voicedata->sttmanager) {
+ if (voicedata->sttmanager->GetCurrent() == STT_STATE_RECORDING ||
+ voicedata->sttmanager->GetCurrent() == STT_STATE_PROCESSING) {
+ PRINTFUNC(DLOG_DEBUG, "STT_STATE_RECORDING or STT_STATE_PROCESSING\n");
+ try{
+ voicedata->sttmanager->Cancel();
+ }catch(is::stt::SttException &e){
+ PRINTFUNC(DLOG_ERROR, "reason : %s", e.what());
+ }
}
}
}
is::ui::WInputSttMicEffect *ieffect = new is::ui::WInputSttMicEffect();
if (ieffect) {
- ieffect->SetSttHandle(voicedata->sttmanager->GetSttHandle());
+ if (voicedata->sttmanager)
+ ieffect->SetSttHandle(voicedata->sttmanager->GetSttHandle());
is::ui::MicEffector *effector = new is::ui::MicEffector(canvas, voicedata->layout_main, *ieffect);
voicedata->ieffect = ieffect;
voicedata->effector = effector;
- ieffect->SetProgressBar(voicedata->progressbar);
- ieffect->SetSttHandle(voicedata->sttmanager->GetSttHandle());
+ if (voicedata->progressbar)
+ ieffect->SetProgressBar(voicedata->progressbar);
}
voicedata->mo->Update();
try {
voicedata->state = STT_STATE_VAL_PREPARE_LISTENING;
- voicedata->sttmanager->Start();
+ if (voicedata->sttmanager)
+ voicedata->sttmanager->Start();
}
catch (is::stt::SttException &e) {
PRINTFUNC(DLOG_ERROR, "%s", e.what());
PRINTFUNC(NO_PRINT, "");
VoiceData *vd = (VoiceData *)data;
- if (vd == NULL)
+ if (vd == NULL || vd->sttmanager == NULL)
return;
int tempVal = vd->sttmanager->GetCurrent();
VoiceData *vd = (VoiceData *) data;
get_stt_default_language(vd);
- vd->sttmanager->SetLanguage(std::string(vd->kbd_lang));
+ if (vd->sttmanager)
+ vd->sttmanager->SetLanguage(std::string(vd->kbd_lang));
vd->mo->Update();
return;
if (str && strlen(str) > 0) {
try {
- if (voicedata->sttmanager->GetCurrent() == STT_STATE_RECORDING ||
- voicedata->sttmanager->GetCurrent() == STT_STATE_PROCESSING) {
- voicedata->sttmanager->Cancel();
- PRINTFUNC(DLOG_DEBUG, "stt entry clicked callback during STT recording and processing");
- //return;
+ if (voicedata->sttmanager) {
+ if (voicedata->sttmanager->GetCurrent() == STT_STATE_RECORDING ||
+ voicedata->sttmanager->GetCurrent() == STT_STATE_PROCESSING) {
+ voicedata->sttmanager->Cancel();
+ PRINTFUNC(DLOG_DEBUG, "stt entry clicked callback during STT recording and processing");
+ //return;
+ }
}
}
catch(is::stt::SttException &e) {