替代词具有空白值。 Api不会返回识别的单词,但令人惊讶的是它可以正确地返回转录。
我尝试使用不同版本的beta,例如beta01,beta02,beta03等。 我在同一个网站上发现了这个问题,但没有人回答。 Google Cloud Speech to Text API - Speaker Diarization
// Print responses as they arrive.
Task printResponses = Task.Run(async () =>
{
while (await streamingCall.ResponseStream.MoveNext(
default(CancellationToken)))
{
foreach (var result in streamingCall.ResponseStream
.Current.Results)
{
int tag = 1;
string speaker = "";
foreach (var alternative in result.Alternatives)
{
foreach (var word_info in alternative.Words) {
if (word_info.SpeakerTag == tag) {
speaker = speaker + " " + word_info.Word;
// Console.WriteLine("Speaker: " + alternative.Transcript);
}
else
{
Console.WriteLine("Speaker {} : {}", tag, speaker);
tag = word_info.SpeakerTag;
speaker = "" + word_info.Word;
}
}
//Console.WriteLine(alternative.Transcript);
}
}
}
}
});