in nlsCppSdk/framework/feature/st/speechTranscriberListener.cpp [30:89]
void SpeechTranscriberListener::handlerFrame(NlsEvent& str) {
NlsEvent::EventType type = str.getMsgType();
switch (type) {
case NlsEvent::TranscriptionStarted:
if (NULL != _callback->_onTranscriptionStarted) {
_callback->_onTranscriptionStarted(
&str, _callback->_paramap[NlsEvent::TranscriptionStarted]);
}
break;
case NlsEvent::SentenceBegin:
if (NULL != _callback->_onSentenceBegin) {
_callback->_onSentenceBegin(
&str, _callback->_paramap[NlsEvent::SentenceBegin]);
}
break;
case NlsEvent::TranscriptionResultChanged:
if (NULL != _callback->_onTranscriptionResultChanged) {
_callback->_onTranscriptionResultChanged(
&str, _callback->_paramap[NlsEvent::TranscriptionResultChanged]);
}
break;
case NlsEvent::SentenceEnd:
if (NULL != _callback->_onSentenceEnd) {
_callback->_onSentenceEnd(&str,
_callback->_paramap[NlsEvent::SentenceEnd]);
}
break;
case NlsEvent::SentenceSemantics:
if (NULL != _callback->_onSentenceSemantics) {
_callback->_onSentenceSemantics(
&str, _callback->_paramap[NlsEvent::SentenceSemantics]);
}
break;
case NlsEvent::TranscriptionCompleted:
if (NULL != _callback->_onTranscriptionCompleted) {
_callback->_onTranscriptionCompleted(
&str, _callback->_paramap[NlsEvent::TranscriptionCompleted]);
}
break;
case NlsEvent::Message:
if (NULL != _callback->_onMessage) {
_callback->_onMessage(&str, _callback->_paramap[NlsEvent::Message]);
}
break;
case NlsEvent::Close:
if (NULL != _callback->_onChannelClosed) {
_callback->_onChannelClosed(&str, _callback->_paramap[NlsEvent::Close]);
}
break;
default:
if (NULL != _callback->_onTaskFailed) {
_callback->_onTaskFailed(&str,
_callback->_paramap[NlsEvent::TaskFailed]);
}
break;
}
return;
}