I was trying to get the result with timespan, the main idea is to make automatic Speech Recognition to VTT(subtitle) using Google API, but the problem is it's giving me all results at the same time so I can't know the timespan.
var speech = SpeechClient.Create();
var config = new RecognitionConfig
{
AudioChannelCount = 2,
Encoding = RecognitionConfig.Types.AudioEncoding.Flac,
SampleRateHertz = 44100,
LanguageCode = LanguageCodes.English.UnitedStates
};
var audio = RecognitionAudio.FromFile(filepath);
var response = speech.Recognize(config, audio);
foreach (var result in response.Results)
{
foreach (var alternatives in result.Alternatives)
{
ContextList context = new ContextList();
Console.WritLine(alternatives.Transcript);
}
}