我在C#寫了一個應用程序使用System.Speech語音識別其在Windows 7 工作正常,但是我創建將在Windows 2003(86)工作在相同的應用程序後,我。微軟語音識別平臺
我的編程環境: Windows 7的64位專業版 Visual Studio 2008中
爲了在我的編程環境來開發這個應用程序我安裝:
1.Microsoft語音平臺 - 服務器運行時(10.1版) (86)
2.Microsoft語音平臺 - 軟件開發工具包(SDK)(10.1版)(86)
3.Microsoft語音平臺 - 服務器運行時的語言(10.1版)
(在這裏安裝SR EN-GB)
在我的程序,而不是系統。語音我使用了Microsoft.Speech.Recognition;在項目屬性
using Microsoft.Speech.Recognition;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// Create a new SpeechRecognitionEngine instance.
sre = new SpeechRecognitionEngine();
// Create a simple grammar that recognizes 「red」, 「green」, or 「blue」.
Choices colors = new Choices();
colors.Add("red");
colors.Add("green");
colors.Add("blue");
GrammarBuilder gb = new GrammarBuilder();
gb.Append(colors);
// Create the actual Grammar instance, and then load it into the speech recognizer.
Grammar g = new Grammar(gb);
sre.LoadGrammar(g);
// Register a handler for the SpeechRecognized event.
sre.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(sre_SpeechRecognized);
sre.SetInputToDefaultAudioDevice();
sre.RecognizeAsync(RecognizeMode.Multiple);
}
// Simple handler for the SpeechRecognized event.
void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
{
MessageBox.Show(e.Result.Text);
}
SpeechRecognitionEngine sre;
}
}
我還設置平臺目標86:
粘貼從SDK文檔此代碼。代碼編譯,但一旦我運行或調試它識別不起作用。任何想法我錯過了什麼?
至少在Windows XP中,你不能沒有從SDK安裝組件運行語音識別軟件。您確定目標計算機上存在必需的組件嗎? – 2010-08-30 13:37:57
的想法是先把在本地機器上這方面的工作,後來把它部署到Windows 2003 我的編程機是Windows 7的64位VS2008具有運行時,SDK和enGB SR安裝如上所述。編譯,在我的機器上運行,但它不能識別選項(顏色名稱) – 2010-08-30 16:32:43
調試時,我注意到在 sre = new SpeechRecognitionEngine(); 屬性: EndSilenceTmeout EndSilenceTmeoutAmbiguous 拋出異常: 「識別器設置不被識別 支持,但計劃繼續執行 – 2010-08-30 16:38:17