2016-12-17 27 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.