Add non-streaming speech recognition examples for MFC (#212)
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
|
||||
// StreamingSpeechRecognitionDlg.cpp : implementation file
|
||||
//
|
||||
// clang-format off
|
||||
#include "pch.h"
|
||||
#include "framework.h"
|
||||
#include "afxdialogex.h"
|
||||
|
||||
// clang-format on
|
||||
|
||||
#include "StreamingSpeechRecognitionDlg.h"
|
||||
|
||||
@@ -15,7 +16,6 @@
|
||||
|
||||
#include "StreamingSpeechRecognition.h"
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
@@ -223,6 +223,7 @@ void CStreamingSpeechRecognitionDlg::InitMicrophone() {
|
||||
// exit(-1);
|
||||
AppendLineToMultilineEditCtrl("No default input device found!");
|
||||
my_btn_.EnableWindow(FALSE);
|
||||
return;
|
||||
}
|
||||
AppendLineToMultilineEditCtrl(std::string("Selected device ") +
|
||||
Pa_GetDeviceInfo(default_device)->name);
|
||||
@@ -309,7 +310,6 @@ void CStreamingSpeechRecognitionDlg::InitRecognizer() {
|
||||
msg += "\r\n";
|
||||
msg += "That's it!\r\n";
|
||||
|
||||
|
||||
AppendLineToMultilineEditCtrl(msg);
|
||||
return;
|
||||
}
|
||||
@@ -398,8 +398,6 @@ void CStreamingSpeechRecognitionDlg::AppendTextToEditCtrl(
|
||||
// put the selection at the end of text
|
||||
my_text_.SetSel(nLength, nLength);
|
||||
// replace the selection
|
||||
CString str;
|
||||
str.Format(_T("%s"), s.c_str());
|
||||
|
||||
std::wstring wstr = Utf8ToUtf16(s);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user