2016-12-17 26 views
0

我目前正在开发一个WinRT 8.1 Store应用程序,并且在这个应用程序中,我使用Bing.Speech SDk,它在一个月前工作正常。但现在它停止工作。我现在找不到它的工作。Bing Speech停止在WinRT 8.1 Store App上工作

这是代码。

使用Bing.Speech;

public async void GetSpeechText() 
     { 
      var credentials = new SpeechAuthorizationParameters(); 
      credentials.ClientId = "ClientID"; 
      credentials.ClientSecret = "My Secret"; 
      SpeechRecognizer SR = new SpeechRecognizer("en-US", credentials); 

      var result = await SR.RecognizeSpeechToTextAsync(); 
      if (result.TextConfidence != SpeechRecognitionConfidence.Low) 
      { 
       lblError.Text = ""; 
       txtBox.Text = string.IsNullOrEmpty(result.Text) ? "" : result.Text.Trim('.'); 
      } 
} 

请指引我

感谢

+0

它扔“到服务访问被拒绝”的错误。 –

回答

0

首先,请检查您的客户端ID和客户端密钥是正确的,你可以去Windows Azure Marketplace Developers page并单击注册按钮。

注:您可能会注意到在页面“DataMarket和数据服务正在退役的顶部的红色旗帜,将停止2016年12月31日之后接受新的订单。现有订阅将从2017年3月31日起退休并取消。如果您想继续服务,请联系您的服务提供商以获取选项。“

然后请确保您已配置您的项目以进行语音识别。

  1. 右击Package.appxmanifest文件,并选择查看代码添加一个能力
<Capabilities> 
<Capability Name="internetClient" /> 
<DeviceCapability Name="microphone" /> 

  • 后立即功能部分并添加扩展部分
  • <Extensions> 
    <Extension Category="windows.activatableClass.inProcessServer"> 
    <InProcessServer> 
        <Path>Microsoft.Speech.VoiceService.MSSRAudio.dll</Path> 
        <ActivatableClass ActivatableClassId="Microsoft.Speech.VoiceService.MSSRAudio.Encoder" ThreadingModel="both" /> 
    </InProcessServer> 
    </Extension> 
    <Extension Category="windows.activatableClass.proxyStub"> 
    <ProxyStub ClassId="5807FC3A-A0AB-48B4-BBA1-BA00BE56C3BD"> 
        <Path>Microsoft.Speech.VoiceService.MSSRAudio.dll</Path> 
        <Interface Name="IEncodingSettings" InterfaceId="C97C75EE-A76A-480E-9817-D57D3655231E" /> 
    </ProxyStub> 
    </Extension> 
    <Extension Category="windows.activatableClass.proxyStub"> 
    <ProxyStub ClassId="F1D258E4-9D97-4BA4-AEEA-50A8B74049DF"> 
        <Path>Microsoft.Speech.VoiceService.Audio.dll</Path> 
        <Interface Name="ISpeechVolumeEvent" InterfaceId="946379E8-A397-46B6-B9C4-FBB253EFF6AE" /> 
        <Interface Name="ISpeechStatusEvent" InterfaceId="FB0767C6-7FAA-4E5E-AC95-A3C0C4D72720" /> 
    </ProxyStub> 
    </Extension> 
    </Extensions> 
    

    由于“DataMarket和数据服务正在退休,将停止2016年12月31日之后接受新的订单。现有订阅将从2017年3月31日开始退休并取消“,我建议您使用WinRT Speech API

    更多信息,你可以参考how to register speechhow to enable a project for speech recognition.