1

Is it possible to convert speech to text without using a web service? I have tried the following solution but the libraries aren't recognised in eclipse,http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207021(v=vs.105).aspx

I'm thinking there has to be a speech recognition API in Windows 8 RT? Does anyone have an implementation of speech recognition in this platform or point me in the right direction?

I'm guessing that these methods are not available on the Windows 8 RT platform,If so are there any alternatives?

I tried the following in an app bar button click event but none of the methods/namespaces are recognized.

            // 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));
Saher Ahwal
  • 9,015
  • 32
  • 84
  • 152
Brian Var
  • 6,029
  • 25
  • 114
  • 212

1 Answers1

1

It looks like the SpeechRecognitionUI class is for Windows Phone 8.

For Windows 8 RT, Microsoft has the The Bing Speech Recognition Control and the class is called SpeechRecognizerUx.

The Bing Speech Recognition Control enables a Windows 8, Windows 8.1, or Windows RT machine to convert audio speech input to written text. It does this by receiving audio data from a microphone, sending the audio data to a web service for analysis, and then returning its best interpretations of user speech as text.

The one 'caveat' (if you don't wanna pay) is that this requires a subscription to Windows Azure Data Marketplace, although the free stuff is pretty generous IMO.

The Bing Speech Recognition Control is only available from the Visual Studio Gallery. To develop with the Bing Speech Recognition Control, you must first subscribe on the Windows Azure Data Marketplace, and then register your application. There is no cost to subscribe for the first 500,000 service calls per month.

Here's a code sample.

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;
    }
}

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

Shiva
  • 20,575
  • 14
  • 82
  • 112
  • Updated. The same MSDN link has it. Note the `ClientId` and `ClientSecret` which are your credentials for the Azure Data Marketplace (the caveat i mentioned). – Shiva Feb 04 '14 at 19:12
  • I'm wondering how I stop the service when I'm finshed taking notes.I'm guessing I would have to have a stop button click event that would call stop on the service? Or would there be a better way to stop it without a button? – Brian Var Feb 04 '14 at 19:15
  • 1
    I think the session automatically stops / ends after a certain number of seconds of silence? Not sure. Take a look at the `SpeechRecognizer.AudioCaptureStateChanged` event and the `SpeechRecognizer.RequestCancelOperation()` method. The former taps into the various states of the speech recognition, and the latter allows you to force cancel a current speech recording session. Between the two, you should be able to fine tune your service. http://msdn.microsoft.com/en-us/library/dn434572.aspx and http://msdn.microsoft.com/en-us/library/dn434585.aspx – Shiva Feb 04 '14 at 19:19
  • Seems that this API isn't available in Ireland.....Any other alternatives out there for achieving this? – Brian Var Feb 05 '14 at 13:43