1

是否可以在不使用 Web 服务的情况下将语音转换为文本?我尝试了以下解决方案,但在 Eclipse 中无法识别这些库, http: //msdn.microsoft.com/en-us/library/windowsphone/develop/jj207021 (v=vs.105).aspx

我在想 Windows 8 RT 中必须有语音识别 API?有没有人在这个平台上实现了语音识别或指出我正确的方向?

我猜这些方法在 Windows 8 RT 平台上是不可用的,如果是的话,有什么替代方法吗?

我在应用栏按钮单击事件中尝试了以下操作,但没有识别任何方法/命名空间。

            // Create an instance of SpeechRecognizerUI.
            this.recoWithUI = new SpeechRecognizerUI();

            // Start recognition (load the dictation grammar by default).
            SpeechRecognitionUIResult recoResult = await recoWithUI.RecognizeWithUIAsync();

            // Do something with the recognition result.
            MessageBox.Show(string.Format("You said {0}.", recoResult.RecognitionResult.Text));
4

1 回答 1

1

看起来该SpeechRecognitionUI课程适用于 Windows Phone 8。

对于 Windows 8 RT,Microsoft 有Bing 语音识别控件该类称为SpeechRecognizerUx.

Bing 语音识别控件使机器能够Windows 8音频语音输入转换为书面文本。它通过从麦克风接收音频数据,将音频数据发送到 Web 服务进行分析,然后将其对用户语音的最佳解释作为文本返回来实现这一点。Windows 8.1Windows RT

一个“警告”(如果您不想付费)是这需要订阅Windows Azure 数据市场,尽管免费的东西是相当慷慨的 IMO。

Bing 语音识别控件仅在 Visual Studio 库中可用。要使用 Bing 语音识别控件进行开发,您必须首先在 Windows Azure 数据市场上订阅,然后注册您的应用程序。订阅每月前 500,000 次服务电话是免费的。

这是一个代码示例。

public MainPage()
{
    this.InitializeComponent();
    this.Loaded += MainPage_Loaded;
}

SpeechRecognizer SR;
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
    // Apply credentials from the Windows Azure Data Marketplace.
    var credentials = new SpeechAuthorizationParameters();
    credentials.ClientId = "<YOUR CLIENT ID>";
    credentials.ClientSecret = "<YOUR CLIENT SECRET>";

    // Initialize the speech recognizer and attach to control.
    SR = new SpeechRecognizer("en-US", credentials);
    SpeechControl.SpeechRecognizer = SR;
}

private async void SpeakButton_Click(object sender, RoutedEventArgs e)
{
    try
    {
        // Start speech recognition.
        var result = await SR.RecognizeSpeechToTextAsync();
        ResultText.Text = result.Text;
    }
    catch (System.Exception ex)
    {
        ResultText.Text = ex.Message;
    }
}

来源: http: //msdn.microsoft.com/en-us/library/dn434633.aspx ?cs-save-lang=1&cs-lang=csharp#code-snippet-4

于 2014-02-04T18:41:00.843 回答