0
ビデオで認識を使用してMicrosft Emotions Apiを使用しようとしているので、クライアントライブラリをダウンロードして使用しようとしましたが、デバッグ時に例外なくステップアウトしますスレッドprbolemかもしれません - それはメソッドで起こります: "recognInVideoAsync"。Microsoft Emotions API、RecognizeInVideoAsync c#
私のコード:
public static async void testEmotionApi()
{
var emotionServiceClient = new EmotionServiceClient("c580db97556e405980212f3ff31ac762");
VideoEmotionRecognitionOperation videoOperation;
using (var fs = new FileStream(@"D:\Downloads\testForApp.mp4", FileMode.Open))
{
videoOperation = await emotionServiceClient.RecognizeInVideoAsync(fs);
}
VideoOperationResult operationResult;
while (true)
{
operationResult = await emotionServiceClient.GetOperationResultAsync(videoOperation);
if (operationResult.Status == VideoOperationStatus.Succeeded || operationResult.Status == VideoOperationStatus.Failed)
{
break;
}
Task.Delay(30000).Wait();
}
var emotionRecognitionJsonString = operationResult.ToString();
}
'Task.Delay(30000).WAIT()の目的は何ですか; '?あなたはすでに非同期呼び出しを待っています... – Milen
ここで提供されている例を守らない理由:https://www.microsoft.com/cognitive-services/en-us/Emotion-api/documentation/GetStarted – Milen
また、サンプルコードにAPIキーを含めるのは良い方法ではありません。 – Milen