gpt4 book ai didi

c# - 无法加载文件或程序集 Bond.IO

转载 作者:行者123 更新时间:2023-11-30 17:29:39 24 4
gpt4 key购买 nike

使用 Microsoft.Bing.Speech nuget 包和 Net Framework 4.6.1调用 RecognizeAsync() 时出现此异常

Could not load file or assembly 'Bond.IO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

我的代码:

public static async Task SpeechToTextStreamPO(Stream audioStream, string textResult)
{
var subscriptionKey = ConfigurationManager.AppSettings["BingSpeechSubscriptionKey"];

Uri ShortPhraseUrl = new Uri(@"wss://speech.platform.bing.com/api/service/recognition");
Uri LongDictationUrl = new Uri(@"wss://speech.platform.bing.com/api/service/recognition/continuous");
CancellationTokenSource cts = new CancellationTokenSource();

var preferences = new Microsoft.Bing.Speech.Preferences("en-IN", ShortPhraseUrl, new CognitiveServicesAuthorizationProvider(subscriptionKey));

// Create a a speech client
using (var speechClient = new SpeechClient(preferences))
{
speechClient.SubscribeToRecognitionResult(async (recognitionResult) =>
{
if (recognitionResult.RecognitionStatus == Microsoft.Bing.Speech.RecognitionStatus.Success)
{
textResult = recognitionResult.Phrases[0].DisplayText;
}
});

var deviceMetadata = new DeviceMetadata(DeviceType.Near, DeviceFamily.Mobile, NetworkType.CellLTE, OsName.Android, "1607", "Dell", "T3600");
var applicationMetadata = new ApplicationMetadata("SampleApp", "1.0.0");
var requestMetadata = new RequestMetadata(Guid.NewGuid(), deviceMetadata, applicationMetadata, "SampleAppService");

await speechClient.RecognizeAsync(new SpeechInput(audioStream, requestMetadata), cts.Token).ConfigureAwait(false);}
}

我已经尝试在 .csproj 中安装不同的版本并更改版本号,但我无法使其正常工作。

有什么想法吗?

最佳答案

将 Bond.Core.CSharp 包更改为 4.2.0 对我有用

关于c# - 无法加载文件或程序集 Bond.IO,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50803039/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com