bool RecogSession::StartRecognition(mrcp_channel_t* pMrcpChannel) { const mpf_codec_descriptor_t* pDescriptor = mrcp_application_source_descriptor_get(pMrcpChannel); if(!pDescriptor) { apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Get Media Source Descriptor"); return Terminate(); } RecogChannel* pRecogChannel = (RecogChannel*) mrcp_application_channel_object_get(pMrcpChannel); /* create and send RECOGNIZE request */ mrcp_message_t* pMrcpMessage = CreateRecognizeRequest(pMrcpChannel); if(pMrcpMessage) { SendMrcpRequest(pRecogChannel->m_pMrcpChannel,pMrcpMessage); } pRecogChannel->m_pAudioIn = GetAudioIn(pDescriptor,GetSessionPool()); if(!pRecogChannel->m_pAudioIn) { /* no audio input availble, set some estimated time to complete instead */ pRecogChannel->m_TimeToComplete = 5000; // 5 sec } return true; }
bool DtmfSession::StartRecognition(mrcp_channel_t* pMrcpChannel) { RecogChannel* pRecogChannel = (RecogChannel*) mrcp_application_channel_object_get(pMrcpChannel); /* create and send RECOGNIZE request */ mrcp_message_t* pMrcpMessage = CreateRecognizeRequest(pMrcpChannel); if(pMrcpMessage) { SendMrcpRequest(pRecogChannel->m_pMrcpChannel,pMrcpMessage); } return true; }
bool RecogSession::StartRecognition(mrcp_channel_t* pMrcpChannel) { RecogChannel* pRecogChannel = (RecogChannel*) mrcp_application_channel_object_get(pMrcpChannel); /* create and send RECOGNIZE request */ mrcp_message_t* pMrcpMessage = CreateRecognizeRequest(pMrcpChannel); if(pMrcpMessage) { SendMrcpRequest(pRecogChannel->m_pMrcpChannel,pMrcpMessage); } const mpf_codec_descriptor_t* pDescriptor = mrcp_application_source_descriptor_get(pMrcpChannel); pRecogChannel->m_pAudioIn = GetAudioIn(pDescriptor,GetSessionPool()); if(!pRecogChannel->m_pAudioIn) { /* no audio input availble, set some estimated time to complete instead */ pRecogChannel->m_TimeToComplete = 5000; // 5 sec } return true; }