语音检测与mapx相结合
来源:互联网 发布:京东数据罗盘 编辑:程序博客网 时间:2024/04/30 17:18
由于mapx5.0.x 版本中有存在中文支持的问题,希望将中文转换成拼音,然后再在mapx通过search()检索地名,本列通过isChineseChar()函数判定输入的语音是否是汉字,决定是否是在地图上显示地点,这样可以用与声音判定,比方根据语音命令执行特定的功能,还会继续学习下去
void CSpeechDlg::OnRecoEvent()
{
USES_CONVERSION;
CSpEvent event;
// Process all of the recognition events
while (event.GetFrom(m_cpRecoCtxt) == S_OK)
{
switch (event.eEventId)
{
case SPEI_SOUND_START:
m_bSound = TRUE;
break;
case SPEI_SOUND_END:
{
if (m_bSound)
{
m_bSound = FALSE;
if (!m_bReco)
{
// The sound has started and ended,
// but the engine has not succeeded in recognizing anything
const TCHAR szNoise[] = _T("<noise>");
m_edit=szNoise;
UpdateData(FALSE);
//::SendDlgItemMessage( m_hDlg, IDC_EDIT_DICT,
// EM_REPLACESEL, TRUE, (LPARAM) szNoise );
}
m_bReco = FALSE;
}
}
break;
case SPEI_RECOGNITION:
// There may be multiple recognition results, so get all of them
{
m_bReco = TRUE;
static const WCHAR wszUnrecognized[] = L"<Unrecognized>";
CSpDynamicString dstrText;
if (FAILED(event.RecoResult()->GetText(SP_GETWHOLEPHRASE, SP_GETWHOLEPHRASE, TRUE,
&dstrText, NULL)))
{
dstrText = wszUnrecognized;
}
// Concatenate a space onto the end of the recognized word
dstrText.Append(L" ");
m_edit=dstrText;
UpdateData(FALSE);
// ::SendDlgItemMessage(m_hWnd, IDC_EDIT_DICT, EM_REPLACESEL, TRUE, (LPARAM) W2T(dstrText) );
if(!isChineseChar(m_edit))
{
CFindGjlx *m_gjlx=new CFindGjlx();
m_gjlx->m_ctrlMapX = &(m_ctrlMapX);
m_gjlx->Create(IDD_GJLX,NULL);
// m_gjlx->ShowWindow(SW_SHOW);
m_gjlx->OnSpeech(m_edit);
delete m_gjlx;
}
}
break;
}
}
}
BOOL CSpeechDlg::isChineseChar(CString str)
{
for(int i=0;i<str.GetLength(); i++)
{
if(str[i]&0x80) //字符
return TRUE;
}
return FALSE;
}
- 语音检测与mapx相结合
- Opencv之HOG特征与SVM相结合的人体检测
- Opencv之HOG特征与SVM相结合的人体检测(增加自举法)
- dwr与spring相结合
- dwr与spring相结合
- SOA与BPM相结合
- 路径与阵相结合
- nodejs与Sublime相结合
- SpringMVC - 与REST相结合
- 企业文化建设与学习相结合
- ffmpeg与jrtplib相结合应用
- ThinkPHP CRUD与缓存相结合
- easyui datagrid 与 progressbar相结合
- qsort()与结构体相结合
- input与select相结合使用
- 数据库与网络请求相结合
- mapx
- pjsip的语音检测
- SharePoint v3:忘掉模拟用户Impersonate,SPSecurity.RunWithElevatedPrivileges来了
- PHP中GBK和UTF8编码处理
- JDBC知识点罗列
- Asp.Net细节性问题精萃
- 2007.04.17 Digital Zoom项目准备递交
- 语音检测与mapx相结合
- 得到 XML 元素
- 用JSmooth将jar文件生成exe文件- -
- 请牛人帮助 syscall
- WebLogic配置EJB集群问题!
- java.util.Iterator和ListIterator学习
- Windows Communication Foundation入门(Part One)
- 收藏一个帅气的技术网站
- 实现将 GridView 导出到 Excel文件中