Как получить доступ к заполненной коллекции слов в Google Speech API? - PullRequest
0 голосов
/ 20 июня 2019

Как получить доступ к заполненной коллекции слов в Google Speech API?

У меня есть следующий код в проекте .NET Console с использованием C # в Visual Studio в Windows 10:

static void Main(string[] args)
{
    Console.WriteLine("Hello World!");

    var speech = SpeechClient.Create();
    var response = speech.Recognize(new RecognitionConfig()
    {
        Encoding = RecognitionConfig.Types.AudioEncoding.Flac,
        SampleRateHertz = 44100,
        AudioChannelCount = 2,
        LanguageCode = "en",
    }, RecognitionAudio.FromFile("C:\\Users\\dbrow_000\\source\\repos\\DotNetConsoleAppSpeechToText01\\DotNetConsoleAppSpeechToText01\\audio.flac"));
    foreach (var result in response.Results)
    {
        foreach (var alternative in result.Alternatives)
        {
            Console.WriteLine(alternative.Transcript);
        }
    }

    Console.WriteLine("**********");

    foreach (var result in response.Results)
    {
        foreach (var alternative in result.Alternatives)
        {
            foreach (var word in alternative.Words)
            {
                Console.WriteLine(word.ToString() + " - " + word.EndTime);
            }
        }
    }

Вывод в командной строке:

Hello World!
The Book of Mormon and the account written by the hand of Mormon upon plates taken from the plates of Nephi it is an abridgment of the record of the people of Nephi and also of the lamanites written to the lamanites who are a remnant of the House of Israel and also to Jew and Gentile written by William commandment and also by the spirit of Prophecy and the Revelation and sealed up and hit up under the Lord but they might not be destroyed to come forth by the gift and power of God under the interpretation they're all sealed by the ham tomorrow night
**********

Как видите, ни одно из слов и значений времени окончания не выводятся на печать.

Что мне нужно сделать, чтобы получить доступ к словам

...